Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Math Programming

The Neuroscience of Computer Programming 161

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).""
This discussion has been archived. No new comments can be posted.

The Neuroscience of Computer Programming

Comments Filter:
  • Reading vs writing (Score:5, Insightful)

    by Anonymous Coward on Sunday February 23, 2014 @09:39AM (#46315547)

    In my experience, coding and reading other's code are two completely different tasks.

  • by IgnorantMotherFucker ( 3394481 ) on Sunday February 23, 2014 @09:49AM (#46315583) Homepage

    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.

  • by Anonymous Coward on Sunday February 23, 2014 @10:11AM (#46315665)

    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.

  • by SunTzuWarmaster ( 930093 ) on Sunday February 23, 2014 @10:37AM (#46315745) Homepage

    In this case, reading, writing, listening, and speaking a foreign language should all be different tasks. The neuroscience doesn't lie: the region of the language processing center lights up; portions of programming are similar to foreign languages.

  • by Capt.Albatross ( 1301561 ) on Sunday February 23, 2014 @12:03PM (#46316119)

    While strictly speaking [computers] do carry out mathematical operations, that's not what most people use them for.

    But calculation is not mathematics, either - or, more precisely, it is not mathematics as practiced by mathematicians doing mathematics. Calculation is what scientists, engineers, econometricians and so forth do when they apply the results of mathematics to issues in their own fields.

    I agree that the current practice of programming is not much like either of these things. Where mathematics (in the applied sense) plays an important part in the development of software (e.g. cryptography, signal processing), the mathematics is generally applied to the problem before coding starts.

  • by aristotle-dude ( 626586 ) on Sunday February 23, 2014 @01:10PM (#46316511)

    The article claimed that programming activated regions of the brain associated with language, not foreign language. Most programming languages they I've seen are in English. If you are a native English speaker, I don't see how this would count as a foreign language. If you are not a native English speaker, I suppose it could count as a really basic English credit.

    I think you are confused. Since I assume that you are a native english speaker and a monolingual one at that, I can understand how you have trouble with this concept. While most programming languages might have "keywords" written in english, they have a distinct syntax that is not exactly the same as natural english syntax which is why it is like thinking/reading in a different language than you are used to.

  • by Anonymous Coward on Sunday February 23, 2014 @01:27PM (#46316641)

    Stupid study.

    Hey guys! Reading written statements (code) uses language centres of the brain - well fuck-de-doo.

  • by Hognoxious ( 631665 ) on Sunday February 23, 2014 @03:50PM (#46317611) Homepage Journal

    The good part is where the programmers just know that it can't be so.

    MRI? No idea what it is. But if it contradicts my preconceptions that:

    a) mathematicians are smarter than literature types
    b) I'm really really smart
    c) what I do must be more like the former
    . . .
    then it's phrenology by a different name.

You will never amount to much. -- Munich Schoolmaster, to Albert Einstein, age 10