ACM Computing Surveys 28A(4), December 1996, http://www.acm.org/surveys/1996/SteinInteractive/. Copyright © 1996 by the Association for Computing Machinery, Inc. See the permissions statement below.


Interactive Programming:
Revolutionizing Introductory Computer Science


Lynn Andrea Stein

Massachusetts Institute of Technology, Artificial Intelligence Laboratory
545 Technology Square, Cambridge, MA 02139, USA
las@ai.mit.edu, http://www.ai.mit.edu/people/las



Abstract: Introductory computer science education is entrenched in an outdated computational model. Although it corresponds neither to our computing environments nor our work, we teach our students a single-thread-of-control problem-solving view of the role of the computer program: computation as calculation. In this model, the job of a computer program is to start with a problem, calculate its answer, return that answer, and stop. We can dramatically improve this situation -- and, as a corollary, all of undergraduate computer science -- with a model of computer programs as simultaneous ongoing entities embedded in and interacting with a dynamic environment: computation as interaction; computation as it occurs in spreadsheets and video games, web applications and robots.

Categories and Subject Descriptors: K.3.2 [Computing Milieux]: Computers and Education - Computer and Information Science Education

General Terms: Computer Science Education, curriculum

Additional Key Words and Phrases: Introductory programming, concurrency, interactive programming, computation as interaction



1. How we teach Intro CS now (and what's wrong with it).

Traditionally, computer science education has begun from the perspective of von Neumann serial computing.[1] We teach people the following model of computation: Begin with a question. Describe the answer in terms of the question. Programming is the process of writing down the sequence of calculations required to get from a particular instance of the question to the corresponding instance of the answer. Computation is the process of executing those steps -- the algorithm -- to deduce the answer to a particular question.

But this model of computation doesn't really correspond to the way that computation exists in the world at large. Most computation these days is not algorithmic question-answering in desktop boxes. Instead, most computation takes place in automobiles and in toaster ovens. It is a parallel, distributed, embedded, continuous, condition-monitoring, event- driven, ongoing, interactive process. It is computation as a living, breathing thing that exists and coexists in a dynamic continuous parallel world. Even the computation that does occur in traditional computers is largely of this sort -- it is spreadsheets and word processors and network access protocols, distributed databases and graphical visualization tools and computer games, rather than mathematical problem-solving per se.

The difference here can be summed up with a simple example. Traditional computer science education begins with

                    print ``hello world'';

-- a simple program which performs its job and exits. This new approach to computation advocates a different starting point:

                    while (TRUE) {
                        echo();
                    }

-- an ongoing process which samples its environment and responds to it. Of course, there's much more to the story of computation-as-interaction than a simple keyboard echo, just as there's much more to traditional computation-as-calculation than printing ``Hello, world!''. But this simple example captures the spirit of the difference, if not all of its implications.

2. How we'd like to teach Intro CS.

Actually, this second model of computation -- the model which starts with interactive computational processes -- makes a compelling first introduction to computer science and to computer programming. The fundamental difference between this approach to computation and the one traditionally taught to our introductory students is the following: in intro CS now, students are allowed to assume that there is a single thread of execution and that it is under their control.[2]

This course changes the terms of the debate simply by beginning from the premise that there are multiple parallel threads of execution.

By starting with interactive computational processes, we make it possible to talk -- and think -- about the computational world in ways that students now don't experience until late in their undergraduate careers (or beyond). If we teach this model in the first course, we begin our students with the mindset that their work is part of a dynamically interacting system; their goal is to build a piece (or pieces) which coexist and cooperate and collaborate. We can also expose them to a wide variety of topics which are now relegated to upper-level and graduate courses.

In fact, most researchers in computer science would probably agree that this model of computation is at the heart of most of the activity at the frontiers of computer science today. Of course, once students have learned this broader model, they can easily be introduced to von Neumann serial computation as a (significant) special case. But it turns out that most of traditional computer science education follows at least as naturally from this altered introduction.

3. Where to go from here

Further details of this course, both in vision and in actual implementation, are described elsewhere. An extensive paper overviews one approach to this course, beginning with the argument made here. That paper takes robotics as its central motivating idea. A sample syllabus outlines one implementation of these ideas in a current course-in-progress (at the time of this writing). This course focuses exclusively on the on-line world. Both the course and the efforts behind it are a part of the Rethinking CS101 project. Further information on the project, including up-to-date pointers to our most recent efforts, may be found at http://www.ai.mit.edu/projects/cs101/.

Acknowledgments

Early versions of many of these ideas were developed jointly with Jim Hendler of the University of Maryland at College Park. Beyond credit for the ideas, he deserves tremendous thanks for support, encouragement, and a sustained commitment which has been invaluable in their (and my) development. Although not a part of the formal development of these ideas, Hal Abelson, Rod Brooks, Eric Grimson, Gill Pratt, and Gerry Sussman have all been critical to their growth. Each in his own way has also been both a facilitator and an inspiration. All of my students, but especially Mark Torrance, Mike Wessler, and Holly Yanco, have not only sat through innumerable recountings of this story, but have actually stayed awake long enough to contribute to it. Finally, I am grateful to the staff and students of the AAAI '93 Robot Building Lab, the Robot Building Cooperative at the MIT Edgerton Center, and those who braved the summer and fall '96 versions of this course.

This material is based upon work supported by the National Science Foundation under Young Investigator Award No. 93-57761. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation.


Footnotes

[1]
I am in fact lumping together a wide range of approaches to introductory computation. (See, for example, (Abelson, Sussman, and Sussman, 1985; ACM, 1991; Connor, Niguidula, and van Dam, 1995; Roberts, 1995) for a variety of different course curricula.) Although there are many variants, with significant pedagogic and curricular distinctions, the single-thread-of-control sequentialist paradigm is virtually universal.
[2]
This has not in fact been true for decades, since the advent of the timesharing system, but until sometime in the 1980s most applications programs subscribed to the pretense of a single thread. Increasingly, however, students laboring under this illusion must first be retrained to deal with the realities of embedded multi-threaded computation before they can appreciate the worlds of applications programming or advanced computer science.


Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Publications Dept, ACM Inc., fax +1 (212) 869-0481, or permissions@acm.org.


Last modified: Fri Oct 11 12:33:51 EDT 1996
Lynn Andrea Stein <las@ai.mit.edu>