FEATURE
WHAT’S IN THE BOX?
METAPHORS AND MISCONCEPTIONS
Teaching new concepts is more difficult if the related vocabulary isn’t familiar to learners, but explaining variables using the box metaphor runs the risk of misconceptions STORY BY Jane Waite, Felienne Hermans, and Efthimia Aivaloglou
he English Key Stage 2 (ages seven to eleven) Computing curriculum requires pupils to “work with variables”. Variables are the first step of students learning about data structures. Students will encounter many data structures, such as arrays, lists, and binary trees, as they progress into Key Stage 3 and beyond. But in primary, we just have to help them “work with variables”. Simply put, a variable is a reference — pointing to somewhere in memory — where a value is stored. An example of this would be to store a date, say today’s date, in memory location 1, and our birth date in memory location 2. To remember which date is where, we use variable names, such as Today’s Date and Jane’s Birthday. The first mental model that pupils develop about a concept is important, as it can be very hard to change and, if it’s not right, can lead to barriers to learning and loss of confidence. Variables are a fundamental idea for programming, so it’s worth thinking carefully about what mental models pupils will develop for this concept. ‘Variable’ is a term that students might come across in a range of contexts (this is called topical word learning), such as its colloquial use referring to something that varies, or in other school subjects such as science or maths. However, each of these contexts has subtly different meanings than the computer programming concept of a variable.
108
The Big Book of Computing Pedagogy
All figures by Jane Waite and box from Pixabay CC0 Public Domain
T
n Figure 1 Create a variable: make and label a box
One way to explain computer programming variables is to use a metaphor. Metaphors often have a limited shelf life — they work for so long and then they need to be replaced, as there will be differences between the working of the metaphor and the concept we are linking it to. This is true of the metaphors and methods used to explain programming variables. A common metaphor used to explain variables is the box metaphor. This seems like an attractive way to make a new word more familiar.
How does the metaphor work?
The box metaphor goes as follows: 1. As shown in Figure 1, the box is made and a label is placed or written on it. The box is the variable, and has a variable name (Score) — we’ve created a variable! 2. As shown in Figure 2, values can be placed in the box — simply put, these might be numbers, text, or yes/no type values, and can be the initial value or updated values 3. As shown in Figure 3, values can be retrieved from the box by looking inside