A group of researchers led by engineering professor Westley Weimer and grad student Yu Huang used real-time fMRI readings to look inside coders’ brains while they program. This “mind reading” project studied whether manipulating data structures in a program (like balancing a tree) uses the same parts of the brain as spatial reasoning (rotating a map or turning a key in a lock).
Study participants were tasked with mentally manipulating lists, arrays, and trees. Afterwards, they completed mental rotation tasks such as determining if two perspective drawings portrayed the same 3D shapes.
Ultimately, researchers concluded that data structure and spatial operations are related but distinct neural tasks, using the same regions of the brain but to different degrees. In fact, 95% of the study’s tree problems and mental rotation problems were statistically indistinguishable.