TEACHING RECURSION BEFORE LOOPS IN CS1

Traditionally, loops are a central topic in a CS1 course but recursion is viewed as an advanced topic that is either taught near the end of the course or not taught at all. Taking a cue from the function-oriented programming community, we argue that there are strong pedagogical reasons for teaching recursion before loops in a CS1 course, regardless of what programming paradigm is taught. In our approach, recursion is presented as an instance of the classic "divide, conquer, and glue" problem solving strategy. Iteration is then presented as a particular pattern of recursion. Finally, loop constructs are presented as concise idioms for iterative patterns. We describe our positive experience in adopting this approach in a CS1 course and highlight the aspects of the course that we think contribute to its success.

[1]  Eric S. Roberts,et al.  The art and science of C - a library-based introduction to computer science , 1994 .

[2]  Fintan Culwin Java: an object first approach , 1998 .

[3]  R. Bird Introduction to functional programming using Haskell, Second Edition , 1998 .

[4]  Carl Hewitt,et al.  Comparative Schematology , 1970 .

[5]  Brendan Horton Software solutions , 1997, Nature.

[6]  John W. Satzinger,et al.  The Object-Oriented Approach , 1995 .

[7]  W. P. Salman,et al.  How to Program , 1983 .

[8]  Rick Decker,et al.  programming.java: An Introduction to Programming Using Java , 1997 .

[9]  Heinz-Otto Peitgen,et al.  Part One Introduction to Fractals and Chaos , 1992 .

[10]  Cay S. Horstmann Computing Concepts with Java Essentials , 1997 .

[11]  Henry MacKay Walker,et al.  A revised model curriculum for a liberal arts degree in computer science , 1996, CACM.

[12]  Eric S. Roberts,et al.  Loop exits and structured programming: reopening the debate , 1995, SIGCSE.

[13]  Cheng-Chih Wu,et al.  Conceptual models and cognitive learning styles in teaching recursion , 1998, SIGCSE '98.

[14]  Lawrence Charles Paulson,et al.  ML for the working programmer , 1991 .

[15]  Guy L. Steele Debunking the “expensive procedure call” myth or, procedure call implementations considered harmful or, LAMBDA: The Ultimate GOTO , 1977, ACM '77.

[16]  Judy M. Bishop Java Gently: Programming Principles Explained , 2001 .

[17]  Richard E. Pattis,et al.  Karel ++ A Gentle Introduction to the Art of Object-Oriented Programming , 1996 .

[18]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[19]  John A. Mariani,et al.  Java: First Contact , 1997 .

[20]  Patrick Henry Winston,et al.  On to Java , 2001 .

[21]  Eric S. Roberts,et al.  Thinking recursively , 1986 .

[22]  Hartmut Jürgens,et al.  Fractals for the Classroom: Part One Introduction to Fractals and Chaos , 1991 .

[23]  Norman E. Gibbs,et al.  A model curriculum for a liberal arts degree in computer science , 1986, CACM.