Neurological divide: an fMRI study of prose and code writing
Ryan Krueger, Yu Huang, Xinyu Liu, Tyler Santander, Westley Weimer, Kevin Leach
Abstract
Software engineering involves writing new code or editing existing code. Recent efforts have investigated the neural processes associated with reading and comprehending code -however, we lack a thorough understanding of the human cognitive processes underlying code writing. While prose reading and writing have been studied thoroughly, that same scrutiny has not been applied to code writing. In this paper, we leverage functional brain imaging to investigate neural representations of code writing in comparison to prose writing. We present the first human study in which participants wrote code and prose while undergoing a functional magnetic resonance imaging (fMRI) brain scan, making use of a full-sized fMRI-safe QWERTY keyboard.
We find that code writing and prose writing are significantly dissimilar neural tasks. While prose writing entails significant left hemisphere activity associated with language, code writing involves more activations of the right hemisphere, including regions associated with attention control, working memory, planning and spatial cognition. These findings are unlike existing work in which code and prose comprehension were studied. By contrast, we present the first evidence suggesting that code and prose writing are quite dissimilar at the neural level.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers9
- Program Comprehension and Code Complexity Metrics: An fMRI StudyNorman Peitek, Sven Apel, Chris Parnin, André Brechmann et al.ICSE 2021 · 59 citations
- Biases and differences in code review using medical imaging and eye-tracking: genders, humans, and machinesYu Huang, Kevin Leach, Zohreh Sharafi, Nicholas McKay et al.FSE 2020 · 37 citations
- Convergent Representations of Computer Programs in Human and Artificial Neural NetworksShashank Srikant, Ben Lipkin, Anna A. Ivanova, Evelina Fedorenko et al.NeurIPS 2022 · 16 citations
- Connecting the dots: rethinking the relationship between code and prose writing with functional connectivityZachary Karas, Andrew Jahn, Westley Weimer, Yu HuangFSE 2021 · 10 citations
- Breaking the Flow: A Study of Interruptions During Software Engineering ActivitiesYimeng Ma, Yu Huang, Kevin LeachICSE 2024 · 8 citations
Related papers
- Relating Reading, Visualization, and Coding for New Programmers: A Neuroimaging StudyMadeline Endres, Zachary Karas, Xiaosu Hu, Ioulia Kovelman et al.ICSE 2021 · 1 citation
- Studying Programmers Without Programming: Investigating Expertise Using Resting State fMRIZachary Karas, Benjamin Gold, Violet Zhou, Noah Reardon et al.ICSE 2025
- Causal Relationships and Programming Outcomes: A Transcranial Magnetic Stimulation ExperimentHammad Ahmad, Madeline Endres, Kaia Newman, Priscila Santiesteban et al.ICSE 2024 · 2 citations
- fMRI predictors based on language models of increasing complexity recover brain left lateralizationLaurent Bonnasse-Gahot, Christophe PallierNeurIPS 2024 · 15 citations
- CodeGrid: A Grid Representation of CodeAbdoul Kader Kaboré, Earl T. Barr, Jacques Klein, Tegawendé F. BissyandéISSTA 2023 · 4 citations
