Researchers watched students’ brains as they learned to program
Study reveals how the human brain learns to code
Johns Hopkins University
image:
After college students took a programming course, parts of their brain activated as they read code. Surprisingly, before the students took the class or knew anything about programming, the same groups of neurons also fired when the students read the programs described in plain English
view moreCredit: Yun-Fei Liu/Johns Hopkins University
Computer programming powers modern society and enabled the AI revolution but little is known about how our brains learn this essential skill. To help answer that question, Johns Hopkins University researchers studied the brain activity of university students before and after they learned how to code.
After the students took a programming course, parts of their brain activated as they read code. Inside these areas, groups of neurons represented the meaning of code. Surprisingly, before the students took the class or knew anything about programming, the same groups of neurons also fired when the students read the programs described in plain English.
The federally-funded work, newly published in the Journal of Neuroscience, provide insight into how and why the human brain programs.
“Many of the things we do in the modern world, our brains didn’t evolve to do, including programming, driving, reading and math,” said senior author Marina Bedny, a cognitive neuroscientist who studies brain plasticity and development. “A programming class ‘recycles’ your logic brain areas for code. What we found is that by the time you get to college your brain already has the neural foundations for programming.”
AI tools are making coding increasingly accessible. With more people gaining access to programming, Bedny and first author Yun-Fei Liu, a postdoctoral fellow, set out to discover how the human brain adapts as novices begin to learn the skill.
The team used functional magnetic resonance imaging (fMRI) to track the brain activity of undergraduate students before and after they took a semester-long introductory course in Python, a programming language.
When students read code after the course, groups of neurons in a part of the brain responsible for logic, the fronto-parietal regions, represented the meaning of the programs. But even before class, when students read plain English descriptions of the coding programs, the same neurons already activated for the program algorithms.
“Learning to code uses the same neural machinery that we use for logical problem-solving. Everyone has these abilities,” said Liu, who investigates how the brain learns educationally relevant cultural skills.
The findings suggest that all humans are equipped with the foundation needed to learn programming—which is mostly logic. And exercising those logic muscles through puzzles, games and everyday dinner-table debates might prime kids for future programming success.
“Someone not familiar with coding might look at Python and feel like they’d never be able to understand it, but our study suggests all of us have the capacity to code,” Bedney said. “We might even be born with it.”
Journal
JNeurosci
How people learn computer programming
To acquire computer programming skills, the brain repurposes cognitive areas typically involved in logical reasoning.
Society for Neuroscience
The ever-growing use of technology in society makes it clear that computer programming may be a valuable skill. But how do our brains learn to code? Cultural skills, like reading and math, typically emerge by repurposing brain networks that function for more innate purposes. Yun-Fei Liu and Marina Bedny, from Johns Hopkins University, tested whether this may be the case when people learn computer programming in their JNeurosci paper.
The researchers recorded brain activity in study volunteers with no programming experience before and after they learned how to code using Python. A neural network in the left side of the brain that is involved in logical reasoning was active while participants read about programming algorithms before any formal instruction or skill acquisition. Liu elaborates, “We showed the participants programming algorithms described in plain English prior to learning Python. You would think that the language network of the brain is important for understanding this information when it is presented this way. But the brain network primarily activated was the logical reasoning one.” After learning Python, this network continued to engage strongly with programming code.
According to the authors, this work suggests that human brains repurpose cognitive areas involved in reasoning to learn and acquire computer programming skills. Does this mean that people who are better at logical reasoning are more adept at learning computer programming? Says Liu, “We haven’t looked at a correlation between learning outcomes and neural responses. Currently, we are examining whether logical reasoning test scores can predict how well people perform in a computer program writing task.”
###
Please contact media@sfn.org for full-text PDF.
About JNeurosci
JNeurosci was launched in 1981 as a means to communicate the findings of the highest quality neuroscience research to the growing field. Today, the journal remains committed to publishing cutting-edge neuroscience that will have an immediate and lasting scientific impact, while responding to authors' changing publishing needs, representing breadth of the field and diversity in authorship.
About The Society for Neuroscience
The Society for Neuroscience is the world's largest organization of scientists and physicians devoted to understanding the brain and nervous system. The nonprofit organization, founded in 1969, now has nearly 35,000 members in more than 95 countries.
Journal
JNeurosci
Subject of Research
People
Article Title
Learning to Program “Recycles” Preexisting Frontoparietal Population Codes of Logical Algorithms
Article Publication Date
27-Oct-2025
No comments:
Post a Comment