Learning Looping: From Natural Language to Worked Examples
One important introductory concept in many CS courses is repetition (looping), the automated repeating of individual commands. In this work, we present results from a study of college undergraduates’ naive conceptions of repetition, their difficulties with learning to construct valid repetition statements, and their abilities to apply what they have learned to new problem solving situations. Although computer programming is a new topic when high school or college students encounter it for the first time, students can draw upon their previous life experiences when solving problems. Those conceptions that align with CS topics [2,3] have been shown to be influenced by students’ prior experiences. Alignment through analogies can be helpful  although where the scientific concept differs, common knowledge can hinder learning .
For many students, the topic of looping is their first encounter with nonlinearity in their programs. Until this point, each line of code is executed once, and then control moves to the next line of code. Such linearity makes reasoning about the programs straightforward. With the addition of looping, in the code you will need to evaluate a termination condition and then either repeat prior lines of code, or move to the next statement after the loop. While returning to a previous command or location is not unusual in everyday life and natural language, it is an important change in the way that novices see their code.
KeywordsNatural Language Transfer Test Nest Loop College Undergraduate Learn Loop
- 3.Sudol, L.A., Stehlik, M., Carver, S.: Mental models of data. In: Proceedings of the 9th Koli Calling International Conference on Computing Education Research (2009)Google Scholar
- 4.Vosniadou, S.: Mental models in conceptual development. Model Based Reasoning: Science, Technology, Values 1 (2002)Google Scholar