The Neuroscience of Computer Programming
Hugh Pickens DOT Com writes "Chris Parnin has an interesting read about an international team of scientists lead by Dr. Janet Siegmund using brain imaging with fMRI to understand the programmer's mind and to compare and contrast different cognitive tasks used in programming by analyzing differences in brain locations that are activated by different tasks. One recent debate illuminated by their studies is recent legislation that considers offering foreign-language credits for students learning programming languages. There have been many strong reactions across the software-developer community. Some developers consider the effort laudable but misguided and proclaim programming is not at all like human language and is much closer to mathematics. Siegmund observed 17 participants inside an fMRI scanner while they were comprehending short source-code snippets and found a clear, distinct activation pattern of five brain regions, which are related to language processing, working memory, and attention. The programmers in the study recruited parts of the brain typically associated with language processing and verbal oriented processing (ventral lateral prefrontal cortex). At least for the simple code snippets presented, programmers could use existing language regions of the brain to understand code without requiring more complex mental models to be constructed and manipulated." (Read on for more.)
"Interestingly, even though there was code that involve mathematical operations, conditionals, and loop iteration, for these particular tasks, programming had less in common with mathematics and more in common with language (PDF)," writes Parnin. "Mathematical calculations typically take place in the intraparietal sulcus, mathematical reasoning in the right frontal pole, and logical reasoning in the left frontal pole. These areas were not strongly activated in comprehending source code." The new research results are a much needed, but only a first step in revealing the neuroscience of programming. Other questions remain including: Can we finally provide a neurological basis for a programmer's flow? How relevant is the mastery of language skills for programming? Are there certain programming activities that should never be mixed, due to higher chance of cognitive failure (and resulting bugs)? Do code visualizations or live programming environments really reduce mental load? "Programming involves a rich set of cognitive processes," concludes Parnin. "Although the study found a particular pathway that was strongly associated with language processing, there may be other pathways associated with other common activities related to programming (debugging, editing, refactoring, etc).""
In my experience, coding and reading other's code are two completely different tasks.
For quite a long time now, I've been explaining to everyone who will sit still long enough to listen that the term "computer" is a bad name for what these boxen do.
While strictly speaking they do carry out mathematical operations, that's not what most people use them for. They got the name "computer" because one of the earliest uses of computers was the numerical solution of differential equations. For example the Von Neumann architecture was developed by Dr. Von Neumann for use in designing hydrogen bombs. The Difference Engine was Charles Babbage's fat defense contract for the purpose of calculating firing tables, that is, how to aim a cannon, taking into account the wind and so on.
Really these boxen are instruction following machines. I was able to finally explain to my mother what I really do, and what a programming language really is, by asking her to compare her applications that I might have written, to her writing down the recipe for chocolate chip cookies. That recipe could be written in English, or in German or what have you. English and German could then be taken to be recipe languages, much as Java and C++ can be considered programming languages.
Why just the other day, I told a good friend that I wanted to return to graduate school to complete my Physics Doctorate, but had forgotten all my math. This because it is exceedingly uncommon for programmers to need to know much more than very basic arithmetic on the job. It is actually uncommon for me to use floating point on the job, or fractions. I cannot recall the last time I used a trigonometric function on the job.
However coders do need very strong verbal reasoning skills. If you could win on the debating team, or you studied philosophy in college, I assert you could be a good coder.
Please mail me URLs of software employers.
Well, I know myself. I believe the results in this study are obvious. Most of the time reading code involves parsing which is essentially a linguistic task. Mathematical thought might be more active in specific code sections but language will still account for 99.9% of your mental work. Writing code is probably the same or even more skewed towards language. Of course, I am assuming most people think before sitting down to write code.
It prepares you for jobs because it's not uncommon you will have to deal with people who don't speak your native language. It's also not uncommon for people to move somewhere else because of a job. In non-english countries, it's in your best interest to teach your students english because a lot of information is available in that language.
I don't care if I'm wrong. I only care about everyone obtaining something from the discussion.
Larry Wall: Wall developed the Perl interpreter and language while working for System Development Corporation, which later became part of Unisys.[5] He is the co-author of Programming Perl (often referred to as the Camel Book and published by O'Reilly), which is the definitive resource for Perl programmers; and edited the Perl Cookbook. He then became employed full-time by O'Reilly Media to further develop Perl and write books on the subject.[5]
Wall's training as a linguist is apparent in his books, interviews, and lectures. He often compares Perl to a natural language and explains his decisions in Perl's design with linguistic rationale. He also often uses linguistic terms for Perl language constructs, so instead of traditional terms such as "variable", "function", and "accessor" he sometimes says "noun", "verb", and "topicalizer".
Make sense to me... Language processing areas of the brain are a component of programming.
Try this experiment: Count backward from 100 by 3s. As in 100, 97, 94, 91, 88, etc.
At around 85 have another person -- yes an actual living breathing person -- start calling out random numbers between 1 and 100. See how long you can keep counting.
It's all pure math. But very few people have the ability to keep going amid distractions, even when the numbers are being called out in a foreign language they do not speak or understand.
Programming is like counting backward from 100 by 3s, only thousands of times more complex. Coding while someone is talking nearby can be downright impossible. Clearly there is some overlap between language processing and writing/reading/understanding code.
Sorry, but it's much more deep-rooted than being able to talk to someone in a foreign country.
If you don't get that, you probably don't have many bi-lingual friends and certainly haven't asked them about it.
Being bi-lingual allows you to find patterns, origins, etymologies and structures of words. It's not uncommon from being able to speak French and English to being able to understand Spanish, Italian and maybe a little Portuguese WITHOUT having to learn anything, just hearing a native speaker.
It's provides much greater command of grammar and language structure than is available in English alone.
I speak as someone who was forced to learn only "tourist" German in an English school, who now lives with an Italian fluent in English and has entire swathes of friends who speak foreign languages.
English is universally derided among them for being the easiest to learn. The grammar is pathetic. The rules are arbitrary but easily picked up. The words all comes from Latin or Greek or Germanic originally.
And being bi-lingual opens up the creative areas of the brain associated with language. While you're 3-7 years of age, your brain will accept another language with ease. It won't even hinder you learning other things as you learn it. And you'll be bi-lingual by the time you're an adult with no extraneous effort. However, if you don't get it into the language-processing areas of the brain by that age, you will GREATLY struggle to learn a language later.
And by learning a language, I mean being able to live normally in the country for a year without resorting to translation tools, not asking the way to the airport in a single, broken accent.
My girlfriend's command of multiple languages is impressive. And it comes about because she was taught English in school and it was SO MUCH easier a language to learn than her own. It's basically the baby-language of foreign languages.
It's not about tourism.
It's not about being able to phone up a foreign company and sell to them.
It's literally an expansion of your whole thought processes and language interpretation that allows you a much richer method of communication, no matter what the language.
And while you're a child, you'll just absorb it - like any child in a bi-lingual home. But when you grow up, you'll struggle and have to spend 10 years learning to get the grammar, accent, structure, phrasing and wording correct enough to blend in. And it will never be "natural". But, learning a foreign language in school, it can be "natural" to your thought processes.
They say you know when you've actually learned a language because you dream in it. That's how natural it becomes and you get the richness of expression available from all the languages you know.
It's not about whether you know Perl, or French. It's about being able to genericise concepts enough that even when speaking in several languages at once you get a deeper understanding of what the grammar means and how the structure should be to be common to all languages.
Someone who programs professionally in a range of programming languages will, generally speaking, be more fluent in any particular one. The same as someone who speaks more than one language being, generally speaking, more capable with their use of language overall.
A lot of programming is about understanding a problem, seeing what the real needs are - not the ones that the users think they need. You then need strategic planning on how to meet those needs, a lot of that will be about understanding how the new program will fit into the existing ecosystem. Next comes the translation of that strategy into a programming language (or more: you may also need some SQL, HTML, shell, ...) and the completely different skills of debugging. Finally: documentation for the users and also the programmers [actually: I find that doing the first draft of the documentation before writing the code is a really good idea].
So: programming is much more than just language skills.
Some here have asserted that programming is a branch of maths. This may be true for some sorts of programs (or some subroutines), but it is not true for most of what I do -- although an understanding of maths does help some parts.
Summary: please don't be simplistic, programming is a complex skill that requires many different brain subsystems, language is just one of them.
I've always felt that writing good code is very similar to writing a good essay or research paper. The process is about the same. The thinking is about the same. The ideal steps followed to produce a decent paper are similar to the steps followed to produce decent code.
I've always thought that a good essay writer can make a good programmer. In particular, good essay writers can make good programmer/analysts or project managers. In both worlds, you struggle with scope, organization, and fact finding. Answering the question "What is this paper/program really and truly about?" is the primary task.
Since in college I was hopeless in my foreign language class when listening/speaking were stressed. (And failed those classes multiple times.) When all I had to do was read it(at the same 4th semester level) I passed it the first time and I wasn't even close to failing. (Yes, I realize this is an anecdote but I wouldn't be surprised if there were a difference between reading and listening.)
Did you know 80 to 90% of the moderators on slashdot wouldn't recognize a troll even if one dragged them under a bridge.
Languages take time and effort to learn. Try to remember, C++, although complex by the standards of most computer languages is ridiculously easy compared to learning French. If the programmers spent a proportional amount of time on the foreign language, I think they would have the same level of mastery.
All those moments will be lost in time, like tears in rain.
For me, coding/design/problem solving seems to be mostly 3d abstract visual with objects being represented by some abstract entity and interactions that I can "see" (in quotes because I'm not sure that's what's really going on) and manipulate.
Reading or writing code is a translation to/from the imagery which is the real "code". The imagery is the abstract representation of the solution and where the problem solving happens.
I think that the fact that I am multilingual and have a firm grasp of "logic" is far more useful than any mathematics that I might have learned in school. I view programming as more of an "art" than a science. It is a form of expression and the programming languages are analogous to human languages used in writing stories and prose. One could say that methods of a class are very much like prose on a conceptual level and the class is analogous to a chapter in a book.
Jesus was a compassionate social conservative who called individuals to sin no more.
While it seems logical to me that there would be heavy overlap between the brain regions used for natural language and those for reading programming languages, it's important to remember that "using the same brain region" is *not* equivalent to "thinking in the same way". For example poetry and mathematics both activate many of the same brain regions, presumably because they both involve a lot of pattern recognition and abstract thought.
For that matter, if I recall correctly the language centers of the brain are themselves mostly a subset of the vision centers of the brain, even when dealing with purely spoken language. Probably that pattern-recognition stuff showing up again
--- Most topics have many sides worth arguing, allow me to take one opposite you.
http://www.wired.com/wiredscie...
I suppose that dead salmon should get credits for social science classes in such case...
The Curry-Howard isomorphism is a way to relate programs to proofs and types to propositions. Control flow can be expressed in terms of call/cc and relates to Peirce's law in logic.
I am a programmer and have a degree in Math/Computer Science, but I always scored better on language related aptitude tests than math ... did significantly better on my SAT and ACT tests (in 1989! I'm sure they've changed alot since then!) in language related areas than I ever did in math. Luckily I still got into a good computer science school, got my degree, and have had a pretty good career in software development. I never realized that my skew towards language skill may actually have been a boon for my career choice instead of the disadvantage that I thought it was ...
English is universally derided among them for being the easiest to learn.
English is easy to start learning, but very difficult to master. The first year of learning English is easy, whereas the first year of learning (eg) French is pretty difficult. But after that first year, you know the hard parts of French, and all that's left to learn is the easy stuff. English... well, the worst is yet to come.
The grammar is pathetic. The rules are arbitrary but easily picked up.
Rules that are truly arbitrary are never easy to pick up. Rules must maintain some internal logic.
The problem with English is that its simple syntax and lack of inflectional complexity means that grammatical complexity is transferred to word bundles. The stuff of nightmares for the Spanish learner-of-English is the "phrasal verb". "pick up" may use the words "pick" and "up", but the verb "pick" means "choose", whereas there's no implied choice-of-thing in "pick up". When we "pick up a ladder", we "pick it up". When we "set up a ladder", we "set it up". But when we "go up a ladder" we "go up it". This is internally logical, but despite that, it still trips learners up, because what looks like the same pattern superficially is actually two different ones.
The words all comes from Latin or Greek or Germanic originally.
That doesn't make it easy. German's vocabulary almost all comes from Germanic. French's vocabulary almost all comes from Latin. Modern Greek's vocabulary almost all comes from Ancient Greek. Whereas English has a hodge-podge of the three plus French, and it's difficult to predict which words we use, and which we don't. Our "kings" are Germanic, and when they act "regal" they are Latin, whereas their "royal" virtues are French.
The lack of clear shared roots in related nouns, adjectives and verbs makes the learning of English vocabulary a long and thankless task.
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'