Controlled eye-tracking experiment assesses code comprehension in developers while testing type annotations and naming conventions.
Understanding and modifying source code is a cognitively demanding task shaped by how the code is structured and presented. Prior work has shown that both identifier naming and type annotations can influence program comprehension, yet findings on their in dividual effects remain mixed. This study focuses on how these two aspects interact in influencing program comprehension, visual attention, and subjective perceptions of code comprehensibility. We conducted a controlled eye-tracking experiment with 40 participants who were asked to understand 20 Python code snippets. Our results reveal an interesting dichotomy between objective and subjective findings. Objectively, type annotations slightly slow down developers, but otherwise have almost no statistically significant effect on behavior, visual attention, or subjective perceptions, even when combining them with the meaningfulness of identifier naming. Subjectively, however, nearly all participants felt that type annotations helped with program comprehension. Overall, our findings suggest that type annotations—and their interaction with identifier names—do not generally introduce measurable overhead, but depending on the code snippet and individual participant, may increase developers’ sense of certainty and clarity.
No takes yet. Share an insight, caveat, or question.
Alznauer et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: