In this study, we found that numerous areas of frontal, temporal, parietal, and occipital cortex as well as multiple subcortical regions (caudate nuclei and cerebellum) were activated during programming tasks but not during a control task. Among these regions, however, only activity in the right inferior frontal gyrus was significantly greater during the second fMRI session conducted near the end of a Processing course compared to the first session conducted near the beginning of the course, suggesting a learning-induced increase in regional activity with a rightward shift in dominance. Furthermore, only this right inferior frontal activity was correlated positively with programing performance at the late learning stage. Notably, although the left inferior frontal gyrus was also highly active during the programming task, there were no learning-induced changes or a significant correlation with task performance. Therefore, the right inferior frontal gyrus is selectively modified by programming learning and thus is critical for improved performance.
We found widespread cortical and subcortical activity during the programming task compared to the control task, consistent with previous studies. Siegmund and colleagues also reported activation of left-lateralized brain regions including the middle frontal gyrus, inferior frontal gyrus, prefrontal cortex, inferior parietal lobules, and middle temporal gyrus during programming tasks (Siegmund et al. 2014; Siegmund et al. 2017) and concluded that these regional activities reflected the involvement of working memory, attention, and language processing in program comprehension. Similarly, Castelhano et al. found stronger activation in middle frontal, parietal, and occipito-temporal networks while reading software source code than during the reading of pseudo-code texts (Castelhano et al. 2019) and suggested that these enhanced network activities reflected language processing and working memory, as well as error detection and decision-making required for program comprehension. In contrast, Ivanova et al. reported stronger bilateral activation of the multiple demand system (bilateral frontal and parietal brain regions) compared to the language system (left frontal and temporal brain regions) among experienced programmers while viewing a text-based programming language or a graphical programming language (Ivanova et al. 2020). In general, however, these brain regions identified in previous studies overlapped with those identified in the present study. The left hemispheric activity encompassed the inferior frontal gyrus pars opercularis and pars triangularis, a region involved in speech production (Broca’s area), and the angular gyrus in parietal cortex, a region that integrates speech and vocabulary information (Hickok and Poeppel 2007) or subserves the context-dependent integration and encoding of information during language processing (Branzi et al. 2021). Therefore, our findings of left hemispheric fronto-parietal area activation support the involvement of traditional language processes in programming comprehension.
The main outcome of our study was that programming learning resulted in the increased activation of unique brain regions (i.e., regions subserving program learning per se rather than programming comprehension in general). In the current study, programming-related activity was defined as a relative increase in regional brain activity during the programming task compared to the control task. Activity in left inferior frontal gyrus (pars opercularis and pars triangularis) was equally strong in both early and late stages of the programming course, while notably, activity in the right inferior frontal gyrus pars opercularis and pars triangularis was greater during the late stage of the course (i.e., after learning as confirmed by improved task performance). Furthermore, the laterality of inferior frontal gyri shifted rightward during the late phase relative to the early phase, and right inferior frontal gyrus activity but not left fontal gyrus activity was correlated with task accuracy at the late learning stage. Therefore, this enhanced right inferior frontal gyrus activity appears to reflect programming learning specifically.
To our knowledge, this study presents the first demonstration of functional neuroplastic changes during programming learning. A recent MRI study by Ikutani and colleagues (Ikutani et al. 2021) investigating brain activity among subjects ranging widely in programming expertise hile using a whole brain searchlight analysis (Kriegeskorte et al. 2006) for a program categorization task found a significant correlation of decoding accuracies on the bilateral inferior frontal gyrus pars triangularis with task performance. The participants were divided into advanced, intermediate, and novice programmer (with less than or equal to 4 years of programming experiences). In contrast to that study, however, all participants in our study were novices, so our results likely reflect the earliest neuroplastic changes required for programming learning.
The neural basis of programming learning by beginners may be similar to that of second language learning. Previous neuroimaging studies have revealed both anatomical and functional brain changes in the classical language-related regions of the left hemisphere during second language learning (Chee et al. 2001; Reiterer et al. 2009; Schlegel et al. 2012; Li et al. 2014). The prevailing and classical hypothesis formulated by Obler (Obler 1981) and Galloway and Krashen (Galloway and Krashen 1980) posits that the initial stages of adult second language acquisition recapitulate the right-to-left hemispheric shift in relative hemispheric dominance observed in children when acquiring the mother tongue. The model by Obler (Obler 1981) is sometimes referred to as the ‘stage hypothesis’ in second language acquisition research. According to this model, the relative dominance of the right hemisphere during the initial encounter with novel stimuli such as foreign orthography and semantics would be advantageous (Gordon and Carmon 1976; Cotton et al. 1980). Consistent with this idea, Reiter et al. found that a group with low proficiency for learning a second language showed extensive right-hemispheric involvement as evidenced by electroencephalography (Reiterer et al. 2009). Another longitudinal MRI study found structural neuroplasticity induced by second language training (Hosoda et al. 2013) as evidenced by increased volume of the inferior frontal gyrus pars opercularis and reorganized white matter microstructure involving the fiber connections between pars opercularis and caudate and between pars opercularis and superior temporal gyrus/supramarginal pathways in the right hemisphere. These findings of anatomical changes within the right language network during second language learning resemble those reported in the current study among novices learning computer programming. Our results thus suggest that the functional changes in right inferior gyrus associated with programming learning share common mechanisms with second language learning.
Our study had several limitations. All participants were young adult female university students within a narrow age range, so results may not be applicable to other populations. Conversely, previous studies included almost exclusively male participants (Ikutani et al. 2021; Siegmund et al. 2014; Siegmund et al. 2017; Castelhano et al. 2019), so discrepancies may in part reflect sex differences in cognition and learning strategies. Future studies should examine a larger sex-balanced cohort with a broader age and educational range. The results of our study may also apply only to a specific programming language (Processing), so future studies should compare results using other programming languages such as C, PHP, Java, Python, Go, and Kotlin. Also, our programming tasks mainly involved program comprehension and detection of bugs as these tasks require a wide range of programming skills. However, the results were grouped together for analysis. In future studies, brain activity patterns associated with these individual tasks should be examined separately.