miscon:programming.control.loop-body-variables-reset · draft · trust low · v0.1.1 · kind overgeneralization
Variables reset at the start of every loop iteration
Every time a loop body starts again, the variables changed inside it go back to what they were before the loop.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.control.loop-body-variables-reset
- UUID
300e50db-d430-4eaa-928f-d34e302f6c48- Domain
programming.control- Level band
- primary, middle, secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.control.loop (Miscon)
https://open-misconceptions.github.io/miscon-data/c/programming.variables.variable (Miscon)
Evidence patterns
Pattern 0: trace an accumulator updated inside a loop
reports the value from a single iteration rather than the accumulated value
total = 0
for n in [1, 2, 3]:
total = total + n
print(total)63Discriminators
vs a slip. Consistent across accumulator items; the learner explains that the loop 'starts over'. A slip is an arithmetic error in the running total.
vs programming.variables.variable-keeps-history. History-keepers report too many values; resetters report only the last iteration's contribution.
Relations
conflicts_with- A variable holds exactly one value at a time (external)
A loop checks its condition only at defined points and repeats its whole body (external) resolved_by- A variable holds exactly one value at a time (external)
A loop checks its condition only at defined points and repeats its whole body (external) confusable_withprogramming.variables.variable-keeps-history
Alignments
- progmiscon Scratch/ResetStateEachLoopIteration (close-match)
Provenance
Origin: llm-drafted
- Chiodini, L., Moreno Santos, I., Gallidabino, A., Tafliovich, A., Santos, A. L., & Hauswirth, M. (2021). A curated inventory of programming language misconceptions. In Proceedings of the 26th ACM Conference on Innovation and Technology in Computer Science Education (ITiCSE '21), 380-386. doi:10.1145/3430665.3456343
Inventory consulted for the misconception name and scope only; progmiscon publishes no licence for its text, so Open Misconceptions' statements and examples are written independently. - Swidan, A., Hermans, F., & Smit, M. (2018). Programming misconceptions for school students. In Proceedings of the 2018 ACM Conference on International Computing Education Research (ICER '18), 151-159. doi:10.1145/3230977.3230995
- Sorva, J. (2012). Visual Program Simulation in Introductory Programming Education (Doctoral dissertation, Aalto University). Appendix A catalogues introductory programming misconceptions from the literature. link
Drafted from the cited literature for the Open Misconceptions seed pack; statement, examples and discriminators are original text. Awaiting maintainer review.
Review status
Status draft, trust low (computed from the reviews below against the reviewer registry).
No reviews yet.
Formats
- Raw JSON
- CASE 1.1 package (CFItem
300e50db-d430-4eaa-928f-d34e302f6c48) - Source on GitHub
Cite
miscon:programming.control.loop-body-variables-reset
https://open-misconceptions.github.io/miscon-data/m/programming.control.loop-body-variables-reset