Popis: |
Scope is a fundamental topic of computer science and its pervasive nature affects how programmers interpret code on every level. Thus, a strong understanding of scope is necessary for reading and writing code as well as tracing memory usage. This paper qualitatively analyzes students' misconceptions about scope, specifically involving parameters, variable declarations, and loop variables. Our study consisted of five one-on-one interviews where participants were given a set of scope-related problems in Java and Python to solve. We noticed that, despite demonstrating a general understanding of scope, some students became confused about the particular subtypes of scope mentioned previously. Our paper identifies four misconceptions about scope involving parameters, variable declarations, and loop variables: that variable declaration and use are indistinguishable, that where the variable is declared (eg. inside/outside of a method) is not relevant, that passing in a value as a parameter changes the parameter's value globally within the code, and that a loop variable defined to iterate through a for loop is accessible outside of the loop it is declared within. Many of these misconceptions indicate that some participants have an abstract notion about scope that is not equivalent to the programming languages' rules about scope. The information we gathered in this study could potentially help computer science (CS) teachers present scope in a way that prevents the four misconceptions and thus encourage a stronger understanding of scope as a whole. |