The article describes a study carried out on pupils aged 12-13 with no prior programming experience. The study examined how they learn to use loops with a fixed number of repetitions. Pupils were given a set of programming tasks to solve, without any preparatory or accompanying instruction or explanation, in a block-based visual programming environment. Pupils’ programs were analyzed to identify possible misconceptions and factors influencing them. Four misconceptions involving comprehension of the loop concept and repeat command were detected. Some of these misconceptions were found to have an impact on a pupil’s need to ask the computer to check the correctness of his/her program. Some of the changes made to tasks had an impact on the frequency of these misconceptions and could be the factors influencing them. Teachers and course book writers will be able to use the results of our research to create an appropriate curriculum. This will enable pupils to acquire and subsequently deal with misconceptions that could prevent the correct understanding of created concepts.
We survey the literature about the teaching and learning of recursive programming. After a short history of the advent of recursion in programming languages and its adoption by programmers, we present curricular approaches to recursion, including a review of textbooks and some programming methodology, as well as the functional and imperative paradigms and the distinction between control flow vs. data flow. We follow the researchers in stating the problem with base cases, noting the similarity with induction in mathematics, making concrete analogies for recursion, using games, visualizations, animations, multimedia environments, intelligent tutoring systems and visual programming. We cover the usage in schools of the Logo programming language and the associated theoretical didactics, including a brief overview of the constructivist and constructionist theories of learning; we also sketch the learners' mental models which have been identified so far, and non-classical remedial strategies, such as kinesthesis and syntonicity. We append an extensive and carefully collated bibliography, which we hope will facilitate new research.
A reversible sequence of steps from the specification of the algorithm and the mathematical definition of the recurrent solution through the recursive procedure, the tail recursive procedure and finally to the iteration procedure, is shown. The notation for analysing recursive function execution as well as modified flow charts of an algorithm to identify the differences between the iteration and the tail recursion are proposed. All the procedures are written in Logo, so the lists are used as the data structure. Transformation from the recursive procedure to the iterative procedure and vice versa can be shown in such a way in every language in which the recursion is allowed. All examples are one-recursion-call examples and all except one are the functions of discrete mathematics.