MIT and Tufts study reveals how brain handles computer code comprehension.
Are certain brains better suited for computer programming, such as “mathletes” or the polyglot extraordinaire who is flawlessly fluent in five languages? A new neuroscience study published earlier this month in eLife provides new insights that scientifically weigh in this ongoing debate.
Researcher Anna Ivanova from Massachusetts Institute of Technology (MIT) Department of Brain and Cognitive Sciences and McGovern Institute for Brain Research is the lead author of the study in collaboration with senior author Evelina Fedorenko. Other members of the research team include MIT’s Yotaro Sueoka, Hope H. Kean, and Shashank Srikant and Una-May O’Reilly at MIT Computer Science and Artificial Intelligence Laboratory (CSAIL), along with Riva Dhamala and Marina U. Bers at Tufts University.
“It is important to note that code comprehension may be cognitively and neurally separable from cognitive operations required to process program content, that is, the actual operations described by code,” the researchers wrote. “For instance, to predict the output of the program that sums the first three elements of an array, the programmer should identify the relevant elements and then mentally perform the summation.”
Moreover, the researchers point out that code comprehension is a “novel cognitive tool, typically acquired in late childhood or in adulthood," and that "we expect it to draw on preexisting cognitive systems.”
The challenge for the team was to observe the cognitive processes that support code comprehension. To answer this question, the researchers set out to use neuroimaging to locate the areas of the brain that are activated for code comprehension. Specifically, the team used functional magnetic resonance imaging (fMRI).
“Neuroimaging research is well positioned to disentangle the relationship between code comprehension and other cognitive domains,” the researchers wrote.
There have been prior neuroimaging studies on code comprehension with inconclusive results. According to the researchers, none of the prior research “sought to explicitly distinguish code comprehension from other programming-related processes, and none of them provide quantitative evaluations of putative shared responses to code and other tasks, such as working memory, math, or language.”
The study participants were native English speakers with working knowledge of Python or ScratchJr.
ScratchJr is an introductory programming language with graphical coding blocks designed to teach programming to children (ages 5 to 7 years old) that was developed by the MIT Media Lab in collaboration with Tufts University and the Playful Invention Company. ScratchJr is based on the block-based visual programming language Scratch with over 64 million registered users in over 150 countries.
The researchers looked at the brain’s multiple demand (MD) network and language system responses to the text-based Python code and graphical ScratchJr in two separate experiments. The multiple demand system, located in the bilateral frontal and parietal brain regions, is often active during complex cognitive tasks, and is therefore associated with fluid intelligence.
For both experiments, the researchers compared responses to code problems with responses to content-matched sentence problems. They discovered that the brain’s multiple demand system showed robust bilateral responses for text and graphical based coding. However, in contrast, the brain’s language system had a strong response to sentence problems, but “weakly or not at all to code problems.” This led the researchers to conclude that the brain’s multiple demand network “supports the use of novel cognitive tools even when the input is structurally similar to natural language.”
The results of the study suggest that learning to program involves both the brain’s multiple demand network and language systems. This new finding reveals that to the human brain, the process of code comprehension is not the same as reading language. Based on the study results, from an education perspective, teaching computer coding like a foreign language may not be the most efficient approach.
“Overall, we provide evidence that code comprehension consistently recruits the MD system – which subserves cognitive processing across multiple cognitive domains – but does not consistently engage the language system, in spite of numerous similarities between natural and programming languages,” concluded the researchers. “By isolating neural activity specific to code comprehension, we pave the way for future studies examining the cognitive and neural correlates of programming and contribute to the broader literature on the neural systems that support novel cognitive tools.”
Copyright © 2021 Cami Rosso All rights reserved.