<#49#>It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?
<#49#> ---Alan Perlis, <#52#>Epigrams on Programming<#52#>
Many professions require some form of computer programming. Accountants
program spreadsheets and word processors; photographers program photo
editors; musicians program synthesizers; and professional programmers
instruct plain computers. Programming has become a required skill.
Yet programming is more than just a vocational skill. Indeed, <#56#>good programming<#56#> is a fun activity; a creative outlet; a way to express ideas
in a concrete and tangible form. And designing programs teaches a variety
of skills that are important in all kinds of professions: critical reading,
analytical thinking, creative synthesis, and attention to detail.
We therefore believe that the study of program design deserves the same
central role in general education as mathematics and English. Or, put more
succinctly,
<#58#>everyone should learn how to design programs.<#58#>
On one hand, program design teaches the same analytical skills as
mathematics. But, unlike mathematics, working with programs is an active
approach to learning. Interacting with software provides immediate feedback
and thus leads to exploration, experimentation, and
self-evaluation. Furthermore, designing programs produces useful and fun
things, which vastly increases the sense of accomplishment when compared to
drill exercises in mathematics. On the other hand, program design teaches
the same analytical reading and writing skills as English. Even the
smallest programming tasks are formulated as word problems. Without
critical reading skills, a student cannot design programs that match the
specification. Conversely, good program design methods force a student to
articulate thoughts about programs in proper English.
rawhtml2
<#60#>Figure: The basic steps of a program design recipe<#60#>
This book is the first book on programming as the core subject of a liberal
arts education. Its main focus is <#62#>the design process<#62#> that leads
from problem statements to well-organized solutions; it deemphasizes the
study of programming language details, algorithmic minutiae, and specific
application domains. Our desire to focus on the design process required
two radical innovations for introductory courses. The first innovation is
a set of <#63#>explicit design guidelines<#63#>. Existing curricula tend to
provide vague and ill-defined suggestions, such as ``design from top to
bottom'' or ``make the program structural.'' We have instead developed
design guidelines that lead students from a problem statement to a
computational solution in step-by-step fashion with well-defined
intermediate products. In the process they learn to read, to analyze, to
organize, to experiment, to think in a systematic manner. The second
innovation is a radically new programming environment. In the past, texts
on programming ignored the role of the programming environment in the
learning process; they simply assumed that students had access to a
professional environment. This book provides a <#64#>programming environment for beginners<#64#>. It also grows with the students as they master more and
more of the material until it supports a full-fledged language for the
whole spectrum of programming tasks: large-scale programming as well as
scripting.
Our guidelines are formulated as a number of <#65#>program design recipes<#65#>. A
design recipe guides a beginning programmer through the entire
problem-solving process. With design recipes, a beginner almost never again
stares at a blank piece of paper or a blank computer screen. Instead, the
student will check the design recipe and use the question-and-answer
guidelines to make some progress.
~<#60283#>Students should have a copy of figure~#figthedesignrecipe#68> handy at all times. Have them cut it out or make a copy. They should carry the copy with them at all times. When they program, they should pull out their copy and place it near the monitor. By the time midterms come around, students should know the recipe steps by heart. -- The complete set of steps will only make sense after section~#secdesign3#69> has been covered, but that doesn't make any difference. Train them as early as possible.<#60283#>
We created the design recipes by identifying categories of problems. The
identification of a problem category is based on the classes of data that
are used to represent the relevant information. Starting from the structure
of this class description students derive the programs with a checklist.
Figure~#figthedesignrecipe#70> shows the basic six steps of a design
recipe checklist. Each step produces a well-defined intermediate product:
- the description of the class of problem data;
- the informal specification of a program's behavior;
- the illustration of the behavior with examples;
- the development of a program template or lay-out;
- the transformation of the template into a complete definition; and
- the discovery of errors through testing.
The major difference concerns the relationship of steps~1 and~4.
Design recipes help beginners and teachers alike. Teachers can use the
recipes to inspect a beginner's problem-solving skills, to diagnose
weaknesses, and to suggest specific remedial steps. After all, each stage
of the design recipe yields a well-defined, checkable product. If a
beginner is stuck, a teacher can inspect the intermediate products and
determine what the problem is. Based on this analysis, the teacher can then
provide guidance for a specific step in the recipe, raise appropriate
questions, and recommend additional practice exercises.