Although we at Python & Co. are talking about a programming language, reading code for our brains has nothing to do with language learning – but also nothing to do with math. A new study shows that understanding code is a completely unique matter.
How does our brain actually learn a programming language? Researchers don’t know much about this yet. So far, there are two major schools of thought in this area.
Some researchers believe that programming is very close to solving a math problem or logic puzzle. The others compare programming more to learning a language. Both theories are understandable.
Learning programming language: math or language?
After all, developing and understanding code on the one hand is similar to solving a crossword puzzle or puzzle.
On the other hand, it is also obvious to compare learning codes with learning a foreign language. As with new languages, it requires the learning of new symbols and terms, which must also be arranged in a certain order so that the computer executes the commands correctly.
Also, the code must be clearly formulated so that other programmers can read and understand it.
Depending on which theory you believe, you teach a programming language differently. So there is a language-centered approach and an approach based on mathematics and logic.
Now, a recent study at the Massachusetts Institute of Technology (MIT) surprisingly shows that neither side may be right.
Study measures brain activity while reading code
To find out what happens in our brains when we read code, the researchers worked with young programmers.
They presented them with various code snippets in the Python and ScratchJr programming languages. The two languages are known to be particularly visual. The programmers who were examined had a good command of the respective programming language.
So while interpreting the code, the scientists connected them to an MRI machine and observed what was happening in their brains.
Their thesis: If reading code works like reading language, then they would detect activity in the language center in the brain. If, on the other hand, reading a programming language like math works, then the multiple-demand regions in the left hemisphere of the brain would have to be activated.
“Computer code reads your own thing”
The result is surprising. In fact, the language center was not particularly active in any of the programming languages. Rather, the researchers saw activity in the multiple-demand region.
This is the frontal area in our brain that intervenes in particularly complex tasks or multitasking and is also active in mathematics and logic.
However, unlike logic tasks or math, not only the left, but also the right side of the multiple-demand region was active when interpreting code. From this, the researchers conclude that programming and mathematics are not based on the same brain mechanisms.
“Understanding computer code seems to be a thing of its own. It’s not the same as language, and it’s not the same as math or logic,” says Anna Ivanova, the study’s lead author.
Own approaches required
While the MIT study suggests that interpreting a known programming language activates its own brain region, which we do not use for math problems or languages, the researchers do not want to transfer the statements to learning a programming language.
They say: It may be that a young programmer already knows a language so well that neither the math nor the language center in the brain is active. In the same way, however, it may be that newcomers who are just getting into a programming language will still use both regions.
Math or language – maybe that’s the wrong question, says Ivanova. “It seems that computer science teachers need to develop their own approaches to teaching code as efficiently as possible.”