sciencevega-logo
sciencevega-logo

Concept   |   Meet the Editor   |   Publications   |   Support



Watching students’ brains as they learn to program

by | Oct 28, 2025 | Applied Science and Technology

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. Credit: Yun-Fei Liu/ Johns Hopkins University.

Researchers have watched students’ brains in a new study that reveals how the human brain learns to code.

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 provides insight into how and why the human brain programs.

Senior author Marina Bedny, a cognitive neuroscientist who studies brain plasticity and development, said: “Many of the things we do in the modern world, our brains didn’t evolve to do, including programming, driving, reading and math.

“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.”

Increasingly accessible

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.

Liu, who investigates how the brain learns educationally relevant cultural skills, said: “Learning to code uses the same neural machinery that we use for logical problem-solving. Everyone has these abilities.”

Foundation

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.

Bedney concluded: “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.

“We might even be born with it.”

The study is published in the Journal of Neuroscience.

Share This…

Today’s Science – Tomorrow’s Scientists

ABOUT US

ScienceVega and its accompanying website, sciencevega.com, exist to bring today’s science to tomorrow’s scientists. And it will do this in a way which is completely free to both school and pupil. The pathway from GCSE to A-level to degree to scientific career is not always obvious. Quite often it is ambiguous and not enough is done to show a fourteen-year-old the possibilities open to them in a decade’s time.

Many may harbour the vague idea of ‘saving the whales’, but how many know how to get there? How many realise that as they go along their focus might change? The draw of the ocean may remain, but how many realise that instead of studying whales, they actually add to our knowledge of disappearing corals in the Pacific Ocean? Or the marked drop off in populations of crustaceans unique to Western Australia? Or examining fish behaviours in the Indian Ocean? But those careers are there and ScienceVega will showcase them, along with the scientists, both established professors at the top of their field and young PhD scientists just starting out on their career paths.

Should you wish to advertise with us, and help this venture to continue to reach our young scientists, please contact: office@sciencevega.com

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.