This is what happens to your brain when you read computer code

Reading software code is different to reading written language, but it also doesn't rely on parts of the brain activated by maths.

Programming language popularity: JavaScript leads fast-growing Python

Programmers might need to 'read' code in programming languages, but it's not the language-processing part of the brain where blood flow increases during the activity. 

Instead, a group of MIT neuroscientists, found that when reading code, blood flow increased in the multiple demand (MD) network part of the brain, which is typically tapped for maths, logic, and problem-solving tasks like crossword puzzles. 

But the group's findings are ambiguous since the areas of the MD network that were activated by reading code weren't the parts called on for maths, leaving an open question as to whether programming should be taught as a maths-based skill or a language-based skill. 

SEE: Hiring Kit: Python developer (TechRepublic Premium)    

The study involved subjects reading a snippet of the text-based programming language, Python (experiment 1); and a combination of blocks in the the graphical programming language, ScratchJr (experiment 2). Below these snippets of code were the expression of each of the code snippets in a normal sentence.    

The researchers then used a functional magnetic resonance imaging (fMRI) system to see which regions of the brain were activated during code comprehension: the MD system or the language system. 

"We found that the MD system exhibited strong bilateral responses to code in both experiments, whereas the language system responded strongly to sentence problems, but weakly or not at all to code problems," the MIT neuroscientists wrote in a paper published this week in the science journal eLife

"Thus, the MD system supports the use of novel cognitive tools even when the input is structurally similar to natural language."   

The researchers picked two separate groups of just over 20 participants each. All of them knew Python or ScratchJr. 

All participants were recruited from MIT, Tufts University, and the area around the universities, which are both in Massachusetts.  

SEE: Programming languages: Microsoft TypeScript leaps ahead of C#, PHP and C++ on GitHub

The researchers note that reading code activates the MD network but seems to use different parts of it than maths or logic problems activate. They suggest this means that understanding code doesn't precisely replicate the demands of maths, either. 

"Understanding computer code seems to be its own thing. It's not the same as language, and it's not the same as math and logic," says Anna Ivanova, an MIT graduate student and the lead author of the study.

The researchers did not find any regions of the brain that are exclusively devoted to programming. However, they note that specialized brain activity might develop in the brains of experienced coders.


Image: MIT