Is computer code a language or math? MIT study uses brain scans for answers

How our brains interpret computer code could impact how we teach it.

Is computer code a language or math? MIT study uses brain scans for answers
Credit: cottonbro from Pexels
  • Computer coding is a relatively new skill, so our brains can't have specialized areas for it from birth.
  • The question of how we process computer code, as a language or as math, could impact how we teach the subject.
  • A new MIT study suggests our brains treat it as its own special topic.

The comparison between computers and the human brain is hard to get away from. It is often a useful analogy, but sometimes conflicts with how our brains actually work.

One of the continuing questions about how our brains are similar or dissimilar to computers is how they process code. Do we process it as if it is a language or a series of math problems? This question is important for a number of reasons. From an educational standpoint, knowing how our brains work when dealing with coding problems could provide insights into how to teach it.

Some schools are beginning to allow students to select coding languages for a "foreign" language credit and are approaching the subject in the same way they might teach French. This might be a decent way to get more students into coding but could backfire if reliance on language learning techniques is misplaced, for example. Likewise, attempts to teach coding as math might be equally mistaken.

To help settle the debate, a new study analyzed the brain activity of computer programmers while they read code.


"Programs must be written for people to read, and only incidentally for machines to execute." - Harold Abelson.

The study, carried out by a team from MIT and Tufts University, had two dozen participants read code, English, and logic puzzles while in an fMRI machine. By seeing which parts of the brain lit up while doing these tasks, the researchers could determine how our brains process coding languages.

If the areas of the brain associated with language processing were to light up, then we treat code like we treat languages. The same would go for the math parts. The control tasks, reading either a real sentence or a nonsense one and memorizing the location of colored squares, demonstrated the baseline activation levels for these systems in each subject.

The coding languages used in the study were Python, a language considered highly readable by many, and ScratchJr, a symbolic picture code designed for children.

An example of the code and puzzles that might be seen in the experiment. ​

Credit: MIT

When the subjects were in the machine, they were asked to work through the code and predict the output. The brain scans showed only limited responses in the brain's language processing centers, but a considerable amount in the multiple demand (MD) system, which often handles math, logic, and executive tasks.

While this may sound like a win for the "coding is math" argument, it isn't quite the slam dunk you might think it is. This system handles most of our "difficult" thinking and is useful for many things. Logic and math typically cause the left half of it to fire up while the right half handles abstract thinking.

Working with Python caused both sides of the system to activate. ScractchJr worked the right side a little more than the left.

What does this mean?

These findings suggest that the brain handles coding as a unique and complex process. As lead author Anna Ivanova put it: "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."

The authors note that this does not rule out the possibility that very experienced programmers might have specially dedicated areas of the brain for coding. It also doesn't settle what the right way to learn the subject is; it could be the case that learning it requires elements from both pedagogues.

Are there any limits to the study?

This study was very small, it only involved about twenty people, and all of them had knowledge of the coding language they were tested with. The codes used are noted for their readability, and the results may differ if future test subjects without coding knowledge are trying to decipher something like Piet.

Despite these limitations, the study does provide helpful information about how the brain handles coding languages. It will undoubtedly be the first of many investigations into this topic.

Is the universe a graveyard? This theory suggests humanity may be alone.

Ever since we've had the technology, we've looked to the stars in search of alien life. It's assumed that we're looking because we want to find other life in the universe, but what if we're looking to make sure there isn't any?

According to the Great Filter theory, Earth might be one of the only planets with intelligent life. And that's a good thing (NASA, ESA, and the Hubble Heritage Team [STScI/AURA]).
Surprising Science

Here's an equation, and a rather distressing one at that: N = R* × fP × ne × f1 × fi × fc × L. It's the Drake equation, and it describes the number of alien civilizations in our galaxy with whom we might be able to communicate. Its terms correspond to values such as the fraction of stars with planets, the fraction of planets on which life could emerge, the fraction of planets that can support intelligent life, and so on. Using conservative estimates, the minimum result of this equation is 20. There ought to be 20 intelligent alien civilizations in the Milky Way that we can contact and who can contact us. But there aren't any.

Keep reading Show less

Beyond the two cultures: rethinking science and the humanities

Cross-disciplinary cooperation is needed to save civilization.

Credit: Public domain
13-8
  • There is a great disconnect between the sciences and the humanities.
  • Solutions to most of our real-world problems need both ways of knowing.
  • Moving beyond the two-culture divide is an essential step to ensure our project of civilization.
Keep reading Show less

Stephen Hawking's black hole theory proved right

New study analyzes gravitational waves to confirm the late Stephen Hawking's black hole area theorem.

Model of spiraling black holes that are merging with each other.

Credit: NASA's Goddard Space Flight Center
Surprising Science
  • A new paper confirms Stephen Hawking's black hole area theorem.
  • The researchers used gravitational wave data to prove the theorem.
  • The data came from Caltech and MIT's Advanced Laser Interferometer Gravitational-Wave Observatory.
Keep reading Show less
Quantcast