Novices Comprehending Functional vs. Imperative Programs: An Eye-Tracking Study
Zihan Fang, Weizhe Jiao, Robert Tairas, Yu Huang
Vanderbilt University
Abstract
Functional programming (FP) promotes immutability and declarative thinking, offering benefits for reliability, maintainability, and scalability. Despite these advantages, FP remains less widely adopted than imperative programming (IP) languages such as C++. Prior studies have explored this gap by analyzing programmers’ self-reported experiences and performance, but cognitive-level insights for novices are limited. To address this, we conducted an eye-tracking study with 49 novice programmers to compare how they comprehend FP (Racket) and IP (C++) during tasks. We designed six paired tasks that covered similar concepts in both languages and employed a mixed-methods approach, including interviews and surveys, to understand their learning experiences. Participants showed fewer fixations and shorter per-element fixation times in Racket than in C++, yet they also frequently revisited parts of the FP code. This combination of lower per-element measures and higher regression rates suggests different cognitive processing patterns in Racket rather than lower effort. Prior C++ experience did not aid in understanding Racket, but gender differences emerged: women spent more time on Racket without improved outcomes. Participants reported lower satisfaction with FP, citing limited exposure, lack of support, and unclear real-world relevance. Our findings offer insights to inform tools, pedagogy, and strategies for making Racket and related FP instruction more approachable in similar educational settings.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Comprehending Python Repetition Structures: An Eye-Tracking Study with Novice DevelopersarXiv · 2026
- “It Works, but I Don’t Know Why”: Uncritical Use, Verification Behavior and Perceived Understanding in Non-CS Students’ Generative AI-Assisted Programming ProjectsApplied Sciences · 2026
- EXPRESS: Individual variability in reliance on semantic heuristics: Cognitive and psycholinguistic factors.Quarterly journal of experimental psychology (2006) · 2026
- UnexpectedParrots: Iterating Behavioral Experiment Design with In-Silico SimulationsarXiv · 2026
- CogAdapt: Cognition-informed Sparse Adaptation of Code LLMsarXiv · 2026
- On Behavioral Alignment of Model-Code and Human-Code Understandability via Behavioral ProxiesProceedings of the ACM on software engineering. · 2026