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.
what comes around.... metaphysical disunabstraction week
Of all the fully employed programmers you know, how many of them have degrees in English, French, Japanese, Chinese, Literature, Journalism or creative writing? How many in mathematics or physics?
The whole point is just an incentive to get more students to study programming.
Like tax credits for charitable donations, nobody is claiming that the Salvation Army is akin to the government.
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.
That will be a good test of language vs math.
1. How many programmers out there speak more than 2 languages?
2. How many can program in more than 2 languages?
Its likely the answers are 1. not many and 2. most.
I think equating spoken languages to programming languages like this is misguided and makes sens only to tech-ignorant policy makers and scientists looking for juicy grants based on half-baked non-peer-reviewed research.
First, somebody needs to explain why some schools have a foreign-language requirement. The job of high school is to prepare students for jobs upon graduation (not so much any more) and/or prepare students for college. How does one or two years of mandatory foreign language study do either?
All CS or Engineering here.
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".
Thank you, Professor Kugler.
"Love is a familiar; Love is a devil: there is no evil angel but Love." --William Shakespeare ('Love's Labors Lost')
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.
While computer languages are about math a lot more than human languages, coding isn't really like doing math. It's more like telling the machine how to do math, which the machine then does for you.
Brackets contain world's first nanosig, highly magnified:[.]
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.
"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.
Usually, when I'm reviewing legacy source code, I find that the author's mathematical and logical reasoning centers were not strongly activated while writing the code, either.
Programming languages are very much like spoken languages. If you understand the origin language, or have an innate ability to infer meaning, it is possible to naturally understand a new programming language. I studied C++ in high school, so Java and C# are familiar and easily understood. The structures make sense, and if I don't immediately know offhand what something does, I can infer from the surrounding code. The same holds true for spoken languages. English is my first language, and I studied German in school. I never formally studied any other languages because that wasn't my passion. My passion was working with computers. However, I can generally infer the meaning of spoken Spanish in the same way I would deduce the function of unfamiliar code. I look for parts I recognize, use them to help decide what the unfamiliar portion means, and test my guess.
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.
Both try to make it as unambiguously as possible, both try to define the context under which the conditional will be evaluated and the consequent actions/outcome/behavior for the true and false paths.
Both work most of the time for the anticipated context. But when unusual and unanticipated conditions arise, codes trigger bugs and the legislation triggers loopholes. Bugs are sometimes confused with features. Loopholes too are sometimes intended to be there.
Both code and laws need to struggle with legacy issues and maintaining historic behavior sometimes takes precedence over fixing the bug/loophole.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
I use several programming languages, and I can read about 3 human languages. While there are some similarities, I'd say the two things are quite different. However, that doesn't settle the question of what should be taught in school.
I've gone back to school. I'm getting a degree from WGU. For my degree, I could take either American history or sociology. By giving me the choice, the school isn't implying that history and sociology are the same thing. They are saying that either one will improve my education. I see foreign language and programming the same way. Learning either creates a more well-rounded and employable student. I see it as "take either foreign language or programming, not just basket weaving and bird watching".
It is called a computer because that is all it can do - compute. It carries out mathematical procedures. Nothing more.
Then explain the mathematical equivalency to a jump instruction, a variable assignment or an I/O operation.
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.
A lot of people think that. A lot of people think they speak (and write) it better than they do. There's quite a degree of overlap.
And they're wrong. If it was the case, then English kids would be speaking in full sentences at 6 months whereas those who speak your idealised perfect un-pathetic language[1] wouldn't be able to ask for milk before they're hitting puberty.
I don't even know what that's supposed to mean. Should it add noun declensions? Adjectival agreement? Pray tell, O great guru of linguistics.
[1] are you one of those Esperanto twats? You're certainly smug enough.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
You're forgetting the complexity of learning each language and how repetition aids retention. Languages like LUA and Go have as few as 25 keywords and can be learnt in an afternoon. Try and do that with Japanese.
All those moments will be lost in time, like tears in rain.
Some programmers are also terrible and I don't listen to them on matters involving programming let alone linguistics. I have always thought of learning another language and learning another programming languages as similar experiences. At first you try to tie the words almost one for one from one language to another. But once you become fluent you just start doing things differently. But just like anyone going from no language to their first language, they must first learn the basic concepts. But with human languages you do know that there will be a word for car, bus, airplane etc. But a language used by a primitive culture might have one word for airplanes, while, say, English has many many words, (biplane, monoplane, fighter jet, prop plane, etc) the same is in many programming languages. R focuses on concepts while matlab focuses on others as I suspect that people from a pearl diving culture would have shockingly nuanced words for things relating to underwater.
Then you get other nuances such as not using a programming language for long enough generally results in that language becoming rustier and rustier until it is gone. Yet you generally can relearn a forgotten language fairly quickly. An interesting experience would be to see if people even activate the same brain areas relearning a forgotten programming language as those used relearning a forgotten spoken language.
But even within a single spoken language you have cultural differences. People in LA don't generally small talk about the weather, but will go on and on about the traffic during their commute. But in the North East people can talk endlessly about the weather, and in my area the joke goes, "If you don't like the weather, wait 15 minutes." The same with programming languages, using C/C++ as an example you have embedded programmers who obsess over the limitations of their environment and can pack a data-structure with bit for bit perfection; while someone working on a desktop might obsess with making their application installation friendly; and a mobile developer might obsess over screen resolution/sizes. Needless to say while the vast majority of their vocabulary is similar their use of the language can be wildly different yet mutually comprehensible.
Now there might be one tiny catch. A programming language is combination of creativity and some mathematics. Thus the best brain comparison might be to someone doing poetry, someone writing a wordy financial report, and programming.
So my question to any programmer who doubts that spoken languages and programming languages are not hugely overlapping in the brain is: "What part of the brain do you suggest we are using to program? The brain parts that control our bowels?"
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.
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.
Backin the early 1970's the college I went to allowed FORTRAN to satisfy one of the two language requirements.
PFC regions are involved in many different types f tasks. Claiming that PFC activation = language is ummm silly. PFC regions are involved in cognitive control type operations, from which language, LTM, STM, and working memory benefits...etc.
http://www.wired.com/wiredscie...
I suppose that dead salmon should get credits for social science classes in such case...
while studying someone else's code. All the programmers were muttering and cursing under their breath, about what an idiot the programmer was and how much better they could have written the same thing.
RETURN without GOSUB in line 1050
The control groups should have been two other reading selections designed to bracket programming code reading: for example, reading mathematics, such as algebraic proofs, versus reading in an unfamiliar non-math vocabulary like a dense legal contract. It's possible that all would have looked similar, or that two but not three would have been similar, or all different. We just don't know.
And don't let me even get started on the fact that most fMRI studies use far too few subjects and then use absurd values for N like thousands of MRI mapped vertex points in a single subject to reach "significance" (a technique which would be considered a statistical cheat in any other field).
Or this one.
https://github.com/c00kiemon5t...
Don't quote me on this.
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 studied Physics and Chemistry in the College of Science at the University of Southern Mississippi from 1969 to 1973. Our degree requirements called for passing either a proficiency test in one of several 'scientifically' relevant foreign languages or passing one in FORTRAN. I took one semester of FORTRAN and passed the test. I went on to minor in computer science.
In 15 years of formal education in the English language no one ever mentioned the word 'syntax'. We diagrammed sentences and conjugated verbs and identified parts of speech but no one ever explained the mechanics of what or why we were doing it. It was just English and it was necessary. Two weeks into computer programming and I knew WHY it was necessary. Understanding the structure of language, be it a computer language or a human one, I'm better equiped to learn new ones of either type.
Are learning to program and learning a foreign language equlivant? NO. We talk to machines: we communicate in a foreign language.
JMP is a simple addition, ie: add a constant to the instruction pointer..
Variable assignment is basic algebra, X=3.
I/O, again basic algebra. O = fn(I)
Do I also need to explain that "all a computer does" is set a bunch of switches on or off?
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
It's not about programming, it's about reading and understanding code. Also when coding you have presumably worked out what you want to do and are now in the process of translating that concept to code. TFA is not equating coding and natural language, they are merely pointing out the brain uses the same hardware to do both jobs. If you want your entire brain to light up then listening to music is the best brain exercise you can do.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
I don't understand. Why would you ever want to assign a variable to itself, in any language!?
Maybe if they look at computer memory with an MRI....
But lets get to reality here and consider what the topic really is... abstraction. http://abstractionphysics.net/...
I used to think all programming languages were more or less the same, and this opinion was based on having programmed in a variety of languages, and noted how easy it was to understand the gist of a new language pretty much immediately upon seeing it, and coming to understand any nuances involved without too much further study.
Then I ran up against OCaml. And I was humbled. I didn't really realize that there could ever be a computer language as hard to approach as learning a new spoken language, but OCaml showed me the error of my preconceptions.
My favorite moment was when trying to read and understand some gnarly OCaml code (is there *any* OCaml that isn't gnarly to some degree?) and asking on an IRC channel how I would go about figuring out what the "types" were of variables I was seeing as inputs to procedures and used as local variables within procedures. I was surprised by the answer: you can't. It was recommended that I install an OCaml IDE environment and then have the IDE tell me the types. Why? Because it is more or less impossible to know, from inspection, what the type of anything is. I guess the concept of 'type' is a little to gauche for the OCaml crowd.
I never thought I'd run into a language where, in order to read and understand the code, you literally have to *implement a virtual machine in your head and run the code*, but then I ran across OCaml.
I wonder what the brain of someone reading OCaml code would look like under an MRI ...
Oh and to your point ... I don't know where you work, but I think your view is a reflection of your particular experience and not necessarily true across the software development profession. I've been in the industry nearly as long as you have and I haven't noticed any correlation between fluency in multiple spoken languages and programming skill.
When I first came out of college and was young and naive, I thought a great software developer was someone who was really smart, really able to solve complex algorithmic problems. But years in the industry have proven to me that while such talents are important, and people like that are needed, those talents are vastly overshadowed by the more important skill of being able to coordinate with other developers, and to manage detail. The hard part of software development is not on the scale of problems that a single developer faces in daily coding tasks; the hard part is taking 100 developers and figuring out how to produce software that is even 50x as large or complex as that which would normally be written by a single programmer.
A single developer will never be able to compete with an entire software development company in building large or complex software. Competitiveness between large groups of developers is where it's at, and the skills and experience needed for that is an entirely different thing than individual programming genius.
I only have a vague understanding of databases.
Actually I was heavily into scientific computing when I was in school. I'd like to get back into that.
I don't know whether it's changed any, but in 1993, the FORTRAN code used in high energy physics was an awful rat's nest. There was a movement afoot to rewrite it all in C++/
Please mail me URLs of software employers.
I graduated from Auburn University at Montgomery (BS in Business Administration, Management Information Systems major) and never took a foreign language. They used programming classes I took to meet my foreign language requirement.
I'm a fluent French bilingual, but I learnt as an adult in Paris where they are about as patient as New Yorkers.
There's a huge difference between listening, where you have no control over the speed of delivery/level of difficulty and reading where you can take your time, look up 'words' [or pieces of unfamiliar syntax] and writing, harder than reading but you can still pace yourself and work around difficulties.
Otherwise there's anecdotal evidence that 'extra' natural languages are easier after the first one. I feel that's also true of programming languages, the first one is alien, lots of alien concepts [variables, file handles, operations] and the next few, in imperative languages contain the same thing with different syntactic candy. It's to do with memory, usage and repitition then, less with conceptual grasp.
On y va, qui mal y pense!
Can FMRI be used to program without keyboard or voice input?
That's what I really want to know.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
One problem with the interpretations of the scan data, is that few of the medical doctors really understand computers.
We can understand that code in a subroutine can be used by many different apps. But the doctors, at least in the past, seem to assume each section of the brain has a fixed operation. Like a dedicated forming press in a factory. These areas are much more like a milling machine, able to adapt to many operations within a range of options.
The human brain is the most powerful computer that we know, and we don't have the specs or manual. Imagine trying to figure out the main computer in a crashed UFO ! No wonder they are a little lost... 8-)