Introduction to Interactive Programming
by Lynn Andrea Stein
A Rethinking CS101 Project

About these notes

These notes take a novel approach to the subject of computer programming. While traditional introductions concentrate on the sequenced steps to produce some prespecified result, this document focuses on computations better described as ongoing interactive processes. These computations, sometimes called servers or agents, respond to requests or environmental conditions over time. They are defined by their interactive histories -- the ways in which they respond to these requests -- rather than by any "final state" that they achieve. In short, the computations in this document play ongoing roles rather than performing particular one-shot tasks.

This reconceptualization of computation has significant implications for the ground covered by an introductory textbook. These changes are evident from the very beginning: the simplest program -- the "atomic unit" of computation -- is not print "Hello, world!"; -- produce a result and stop -- but instead while (true) { echo(); } -- a program that loops forever, sampling its input and reflecting it back to the user.

These notes are a part of the draft textbook for 6.030: Introduction to Interactive Programming (formerly 6.096), a first course in computer science at the Massachusetts Institute of Technology. Earlier versions of these notes have also been used in 6.75s: Interactive Programming in Java, a one-week intensive minicourse taught in MIT's Professional Institute. The current version was prepared during the summer of 1998 for use in several alpha tests. This version is compliant with Java's 1.1 API.

The notes and the textbook they will eventually become are currently being extensively revised and prepared for publication by Morgan Kauffman Publishers, Inc. At the moment, they are in draft form, and any comments/corrections/suggestions are appreciated. Comments may be sent to ipij@ai.mit.edu or by mail to Lynn Andrea Stein, Massachusetts Institute of Technology, 545 Technology Square #811, Cambridge, MA, 02139, USA.

The most up-to-date information on this book and related course materials is maintained on the world-wide web at http://www.ai.mit.edu/projects/cs101/.

Conventions

Regarding font usage:

In addition:

Acknowledgements

This document would not have been possible without the generous support of the National Science Foundation under Young Investigator Award No. IRI-9357761. 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. Additional support was provided by the Massachusetts Institute of Technology's Classes of 1951 and 1955 Funds and by the Department of Electrical Engineering and Computer Science. The revision of these notes was also supported by the Office of Naval Research through the Science Scholars Program at the Mary Ingraham Bunting Institute of Radcliffe College, where the author was on sabbatical leave as a 1997-98 and 1998-99 Fellow.

The earliest inklings of these ideas probably took root while I was teaching&emdash;and learning to teach&emdash;at Harvard. There is no doubt that that they were nourished in the dynamic environment of Brown's CS Department, which supported many parallel growths. Both my students and my teachers over the years have taught me more than I can say, and the debt I owe them cannot begin to be repayed. My more recent colleagues, at MIT and elsewhere, have been a source of inspiration and challenge, both of which have strengthened the work immeasurably. Feedback, especially concerning industrial relevance and especially from the networked community, has been invaluable.

A significant portion of the writing of this book was completed in the wonderfully nurturing environment that is Radcliffe's Mary Ingraham Bunting Institute. I could not possibly do justice to what that space and time meant to me. Suffice it to say that the Bunting Fellows of 1997-99 are a most remarkable cohort, in whose debt I will forever remain. I hope that this project will be one more testament to the power of Polly Bunting's campaign against the "climate of unexpectation."

Many people have contributed to the development of these ideas; here I can only single out a few individuals to whom I owe the greatest debts. Early versions of some of these ideas were developed jointly with Jim Hendler, and his continued support has been of tremendous benefit. Hal Abelson has been both mentor and inspiration throughout this project, and I'm sure I don't begin to appreciate the extent of his contributions. Kim Bruce was among the work's earliest (and greatest) supporters. Robert Duvall has been a fellow traveller along this road. 

I have had tremendous assistance from the teaching staff who have helped me with the development of this material: Ben Adida, Joshua Reuben Brown, Daniele De Francesco, Robert Duvall, Craig Henderson, Stephanie Hong, Todd Parnell, Salil Pitroda, Lydia Sandon, Luis F. G. Sarmenta, Emil Sit, Maciej Stachowiak, Ben Vandiver, Mike Wessler, Nathan Williams, and Henry Wong; also Matt Domsch, Carol Lee, Karsten Ulland, and Anne Wright, who helped me with an earlier but crazier experiment.

The students who have participated in the several versions of this course -- 6.80s, 6.75s, conference tutorials, and the various versions of 6.096 -- have left their mark in untold ways upon this material. I am indebted to them for their insights as well as their patience.

© 2003 Lynn Andrea Stein

This chapter is excerpted from a draft of Introduction to Interactive Programming In Java, a forthcoming textbook. It is a part of the course materials developed as a part of Lynn Andrea Stein's Rethinking CS101 Project at the Computers and Cognition Laboratory of the Franklin W. Olin College of Engineering and formerly at the MIT AI Lab and the Department of Electrical Engineering and Computer Science at the Massachusetts Institute of Technology.

Questions or comments:
<cs101-webmaster@olin.edu>

cs101 icon