At a basic level, programming is writing a set of instructions for a computer to execute to achieve a desired output. Since computer coding is a relatively new discipline, there hasn’t yet been a ton of research on the associated brain benefits of learning this subject. However, a recent study
helps shed some light on how the brain benefits from learning to program. In this study, 17 participants’ brains were observed using functional magnetic resonance imaging (fMRI) while they comprehended short code snippets. Researchers concluded that there was distinct activation of five brain regions which are connected with working memory, attention and language processing.
Middle Frontal Gyrus
– Gyrus are one of the prominent bumps or ridges on the surface of the brain. The middle frontal gyrus makes up ~1/3 of the frontal lobe of the brain. In the study, researchers observed that this portion of the brain was affected by the programming exercise in 3 key areas:
- Attention – Participants had to understand statements of the source code along with the numbers or words that the source code was manipulating. Since, this task was distributed among more than one cognitive activity; there are benefits for division of attention for learning programming.
- Language – In programming, there are words that ascribe meaning for a given language (Java, C++). Participants needed to read these words and then understand their meaning (example: FOR denotes a loop). As a result, researchers found the silent word reading was improved by programming.
- Working memory – In the study, participants had to keep the value of the variable that the source code was manipulating in mind to understanding the source code. When loops were integrated into parts of the source code, participants had to reason and maintain information about loop iterations. Working memory allows us to memorize spoken information (telephone numbers, email address) as long as we repeat it (spoken aloud or silently). Therefore, those who learn programming can improve their working memory.
- Problem solving – In programming, developers need to abstract from statements and discover why different statements logically work together. For the study, participants were presented patterns and had to determine the rules that construct that material. So, for those who learn programming can improve their problem solving capabilities by initially developing a solution for the problem technically and also by understanding how the technical solution makes sense logically.
Middle Temporal Gyrus
– The middle temporal gyrus is a gyrus in the brain on the temporal lobe. It is located between the superior temporal gyrus and inferior temporal gyrus.
- Semantic memory retrieval – Participants needed to identify the meaning of written words in the source code to successfully understand the source code and its output. To comprehend the code I programming, you need to understand the meaning of single words.
Inferior parietal lobe
- Inferior parietal lobule has been involved in the perception of emotions in facial stimuli, and interpretation of sensory information. The Inferior parietal lobule is concerned with language, mathematical operations, and body image, particularly the supramarginal gyrus and the angular gyrus.
- Problem solving (similar to above) – In programming, developers need to abstract from statements and discover why different statements logically work together. For the study, participants were presented patterns and had to determine the rules that construct that material. So, for those who learn programming can improve their problem solving capabilities by initially developing a solution for the problem technically and also by understanding how the technical solution makes sense logically.
While we are still early days in our understanding of how the brain benefits from learning to code, the initial research is not only encouraging but also provides extra motivation to dive into the wonderful world of technology as it not only helps develop a new skill but also provides great benefits to the brains of programmers.