Study finds brain-activity of people coding isn t quite like when they use language, or do math

The idea was to determine how exactly computer code is comprehended in the brain — how the variables, function names, and keywords become meaningful expressions and then coalesce into a larger whole. Would there be clues for computer science educators — or even some tantalizing insights for the IT world’s developers? And perhaps most notably for computer programming instructors, it seeks to answer the question what part of the brain is most responsible for learning coding skills. Is it the part that does math? Or is it the part responsible for learning language?

Study finds brain-activity of people coding isn’t quite like when they use language, or do math

Screenshot of brain imaging study on mental activity during programming

For a long time, folks have speculated on this. Since coding involves pondering hierarchies of symbols, maybe the mental work is kinda like writing or reading? Others have speculated it’s more similar to the way our brains process math and puzzles.

The brain activity wasn’t similar to when we process language. Instead, coding seems to activate the “multiple demand network,” which — as the scientists note in a public-relations writeup of their work — “is also recruited for complex cognitive tasks such as solving math problems or crossword puzzles.”

“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. [snip]

The researchers saw little to no response to code in the language regions of the brain. Instead, they found that the coding task mainly activated the so-called multiple demand network. This network, whose activity is spread throughout the frontal and parietal lobes of the brain, is typically recruited for tasks that require holding many pieces of information in mind at once, and is responsible for our ability to perform a wide variety of mental tasks.

“It does pretty much anything that’s cognitively challenging, that makes you think hard,” Ivanova says.

Previous studies have shown that math and logic problems seem to rely mainly on the multiple demand regions in the left hemisphere, while tasks that involve spatial navigation activate the right hemisphere more than the left. The MIT team found that reading computer code appears to activate both the left and right sides of the multiple demand network, and ScratchJr activated the right side slightly more than the left. This finding goes against the hypothesis that math and coding rely on the same brain mechanisms.

The usual caveats to this type of research apply, which include: The research subjects are probably “WEIRD”, the meaning of neuroimaging results are filled with debate, this work is very new so you don’t want to overinterpret it, the brain is ultra complex and rilly hard to understand.

There’s some cultural freight here. One reason the scientists are exploring this math/language question is because frankly, we’re pretty bad at teaching programming, and teaching computer science. Nobody quite knows: Do you approach it like math? Like language? Like … what, precisely? In the same vein, is it possible to identify what types of students might really dig it — what sorts of minds will resonate with its odd pleasures? Is it possible to figure out what types of intellectual pitfalls are likely, and how to bridge them?

Just anecdotally — having interviewed hundreds of coders and computer scientists for my book CODERS — I’ve met amazing programmers and computer scientists with all manner of intellectual makeups. There were math-heads, and there were people who practically counted on their fingers. There were programmers obsessed with — and eloquent in — language, and ones gently baffled by written and spoken communication. Lots of musicians, lots of folks who slid in via a love of art and visual design, then whose brains just seized excitedly on the mouthfeel of algorithms.

I’m excited to see what else emerges from this thread of neurological exploration, but I bet the final answer, if we get one, will be like everything else we’re learning about the brain: Crazy complex, super contingent, hard to generalize about.

Techy TikTokers are sabotaging Texas’s abortion whistleblower website

Study finds brain-activity of people coding isn t quite like when they use language, or do math

Following Texas’s ban on abortions as early as six weeks, TikTok activists have made efforts to sabotage the enforcement of the restrictions. An activist has made a script to flood a Texas website used to solicit information on people seeking abortions with fabricated data, according to a TikTok video from the developer and Motherboard’s test… READ THE REST

Screenshot of MIDIBlocks

Oz Ramos is the creator of Handsfree.js, a software library that you can use to add face-, hand- and pose-tracking to any app built in Javascript. It looks incredibly fun and I’m gonna tinker with it this weekend to use in some generative art thingies. Ramos also working on MIDIBlocks — a Scratch-like interface that… READ THE REST

Music, Math, and Language

The paper’s senior author, Evelina Fedorenko, has already been studying the question of whether the brain’s language network is used for other functions, according to an announcement from MIT, which notes that based on her previous work “music and math do not appear to activate this language network.” They also cite Anna Ivanova, an MIT graduate student and the lead author of the study, who explained this next area of exploration. “Here, we were interested in exploring the relationship between language and computer programming, partially because computer programming is such a new invention that we know that there couldn’t be any hardwired mechanisms that make us good programmers.”

Does the brain treat code like natural language? Or like logic and math? We addressed this question by measuring fMRI responses to two very different programming languages – Python and ScratchJr (graphical programming language for kids). 1/n

— Anna Ivanova (@neuranna) April 18, 2020

MIT’s announcement summarize the two schools of thought that Ivanova wanted to investigate. “One holds that in order to be good at programming, you must be good at math. The other suggests that because of the parallels between coding and language, language skills might be more relevant.”

Or, as the researchers explain in the resulting paper, “If code comprehension relies on the same circuits that map form to meaning in natural language, we expect to see activity within the language system” — though they were also studying a second possibility: the “multiple demand” brain regions used for solving complex problems.

Screenshot from MIT-Tufts paper on fMRI brain scans of code comprehension (brains).

The researchers even watched responses to both Python code samples and also to the graphical programming language ScratchJr (which was developed by MIT’s Media Lab working in cooperation with Tufts University and The Playful Invention Company). Their research was conscientiously thorough, the paper explains. “In the Python experiment, we further examine two problem types (math problems and string manipulation) and three basic types of program structure (sequential statements, forloops, and if statements).” The Python tests involved 24 adult participants — 15 women — while the ScratchJr tests involved 19 adult participants — 12 women.

ScratchJr_Interface (Creative Commons image via Wikipedai by Tufts University, Scratch Foundation).

And the results? The researchers discovered that that “multiple demand” region was responding to both kinds of code — even the more visual graphical language. Meanwhile, the language-related region did respond to the sentence-based problems — “but weakly or not at all to code problems.” The final results are succinctly summarized in the paper’s title: “Comprehension of computer code relies primarily on domain-general executive brain regions.”

“However, although reading computer code activates the multiple demand network, it appears to rely more on different parts of the network than math or logic problems do, suggesting that coding does not precisely replicate the cognitive demands of mathematics either.”

Sources:

https://boingboing.net/2020/12/30/study-finds-brain-activity-of-people-coding-isnt-quite-like-when-they-use-language-or-do-math.html
https://thenewstack.io/math-or-language-which-part-of-the-brain-processes-computer-code/
https://www.scientificamerican.com/article/how-brains-seamlessly-switch-between-languages/

Leave a Reply

Your email address will not be published. Required fields are marked *