Towards Comparative Comprehension in CS1: An Exploratory Study using Structured Code Comparisons
TL;DR
This work explores how structured code comparison activities support comparative comprehension in CS1 students transitioning from Snap! to Python, and highlights both the challenges and opportunities of supporting comparative comprehension through structured comparison activities, particularly in terms of timing, scaffolding, and comparison design.
Abstract
Software developers routinely evaluate code alternatives during code review, refactoring, debugging, maintenance, and when adapting examples from online resources or AI-generated suggestions. This skill, known as comparative comprehension, is fundamental yet difficult: developers must compare different implementations and reason about correctness and task alignment. Its importance is increasing as Generative AI tools produce plausible alternative solutions requiring critical evaluation. Despite its growing role in professional software development, CS1 instruction continues to emphasize producing working code over evaluating competing solutions. As a result, an increasingly important skill in programming practice may remain underdeveloped in CS1 instruction. We explore how structured code comparison activities support comparative comprehension in CS1 students transitioning from Snap! to Python. Drawing on work in mathematics education, we designed instructional activities that ask students to analyze alternative implementations, explain differences in program behavior, and justify solution choices. We evaluated these activities through a pilot study using pre- and post-tests and students’ responses to comparison prompts. While we did not observe statistically significant improvements across quantitative measures, our findings reveal patterns in how novice programmers engage with code comparisons. Students frequently relied on surface-level syntactic differences and struggled to reason about program behavior, particularly when comparisons contained multiple differences. These structured code comparisons also exposed misconceptions and false carryover that traditional code-writing tasks often failed to reveal. Our findings highlight both the challenges and opportunities of supporting comparative comprehension through structured comparison activities, particularly in terms of timing, scaffolding, and comparison design.