Variable Evaluation
Tobias Kohn · 2017
For novice programmers one of the most problematic concepts is variable assignment and evaluation. Several questions emerge in the mind of the beginner, such as what does x = 7 + 4 or x = x + 1 really mean? For instance, many students initially think that such statements store the entire calculation in variable x, evaluating the result lazily when actually needed. The common increment pattern x = x + 1 is even believed to be outright impossible. This paper discusses a multi-year project examining how high school students think of assignments and variables. In particular, where does the misconception of storing entire calculations come from? Can we explain the students' thinking and help them develop correct models of how programming works?