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 Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Connecting the dots: rethinking the relationship between code and prose writing with functional connectivity cites Biases and differences in code review using medical imaging and eye-tracking: genders, humans, and machines
- Convergent Representations of Computer Programs in Human and Artificial Neural Networks cites Program Comprehension and Code Complexity Metrics: An fMRI Study
- Convergent Representations of Computer Programs in Human and Artificial Neural Networks cites Connecting the dots: rethinking the relationship between code and prose writing with functional connectivity
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
- Exploring Coding Spot: Understanding Parametric Contributions to LLM Coding PerformanceDongjun Kim, Minhyuk Kim, Yongchan Chun, Chanjun Park et al.ACL Findings 2026
- fMRI predictors based on language models of increasing complexity recover brain left lateralizationLaurent Bonnasse-Gahot, Christophe PallierNeurIPS 2024 · 15 citations
