ArticleslgStudy

computer science

How to Design Programs

How to Design Programs is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand How to Design Programs rather than just read about it. In short: How to Design Programs (HtDP) is a textbook by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi on the systematic design of computer programs. MIT Press published the first edition in 2001 and the second edition in 2018.

How to Design Programs — main illustration
How to Design Programs — illustration

Key takeaways

  • How to Design Programs belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect How to Design Programs to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of How to Design Programs from memory before moving on to harder problems.

Reference excerpt

How to Design Programs (HtDP) is a textbook by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi on the systematic design of computer programs. MIT Press published the first edition in 2001 and the second edition in 2018. In addition to the for-purchase paperback, it is also freely available online. The book is the first one to focus on the systematic design of code as opposed to the syntax of a currently popular programming language. Its key concept is that of a "design recipe", a six-step process for creating programs from a problem statement in a step-by-step fashion. While the book was originally used along with the education project TeachScheme! (renamed ProgramByDesign), it has been adopted at colleges and universities for teaching program design principles, including UBC's popular on-line course. To support its approach to teaching programming, How to Design Program, HtDP introduces five beginner-level programming languages and provides a dedicated integrated development environment IDE.

The Design Recipe According to HtDP, the design process starts with a careful analysis of a problem statement with the goal of extracting a rigorous description of the kinds of data that the desired program consumes and produces. The structure of these data descriptions determines the organization of the program. Then, the book introduces data forms of progressively growing complexity. It starts with data of atomic forms and then progresses to compound forms, including data that can be arbitrarily large. For each kind of data definition, the book explains how to organize the program in principle, enabling a programmer who encounters a new form of data to construct a program systematically.

The Teaching Languages and DrRacket Like Structure and Interpretation of Computer Programs (SICP), HtDP relies on a variant of the programming language Scheme. It includes its own programming integrated development environment (IDE), named DrRacket, which provides a series of programming languages. The first language supports only functions, atomic data, and simple structures. Each language adds expressive power to the prior one. Except for the largest teaching language, all languages for HtDP are functional programming languages.

Pedagogical basis In the 2004 paper, "The Structure and Interpretation of the Computer Science Curriculum", the same authors compared and contrasted the pedagogical focus of How to Design Programs (HtDP) with that of Structure and Interpretation of Computer Programs (SICP). In the 14-page paper, the authors distinguish the pedagogic focus of HtDP from that of SICP, and show how HtDP was designed as a textbook to address some problems that some students and teachers had with SICP. The paper introduces the pedagogical landscape surrounding the publication of SICP. The paper starts with a history and critique of SICP, followed by a description of the goal of the computing curriculum. It then describes the principles of teaching behind HtDP; in particular, the difference between implicit vs. explicit teaching of design principles. It continues on to describe the role of Scheme and the importance of an ideal programming environment, and concludes with an evaluation of content and student/faculty reaction to experience with SICP vs. HtDP. One of the focuses of the paper is the emphasis on the difference in required domain knowledge between SICP and HtDP. A chart in the paper compares major exercises in SICP and HtDP, and the related text describes how the exercises in the former require more sophisticated domain knowledge than those of HtDP. The paper claims the following four major efforts that the authors of HtDP have made to address perceived issues with SICP:

HtDP addresses explicitly, rather than implicitly, how programs should be constructed. To make programming easier, the book guides students through five different knowledge levels corresponding to data definition levels of complexity. The book's exercises focus on program design guidelines, rather than domain knowledge. The book assumes less domain knowledge than that of SICP. The paper distinguishes between structural recursion, where the related data definition happens to be self-referential, requiring usually a straightforward design process, and generative recursion, where new problem data is generated in the middle of the problem-solving process and the problem solving method is re-used, often requiring ad hoc mathematical insight, and stresses how this distinction makes their approach scalable to the object-oriented (OO) world. The paper concludes with a description of responses from various faculty and students after having used HtDP in the classroom.

References

External links Official website, 2018 2nd edition, 2003 1st edition

Worked examples

Example 1 — a first encounter with How to Design Programs

Start with the simplest possible case. Write down what How to Design Programs claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to How to Design Programs before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about How to Design Programs ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of How to Design Programs

In research
How to Design Programs appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses How to Design Programs in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
How to Design Programs is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2001 non-fiction books, Computer programming books, Computer science books, so understanding it makes those chapters shorter.
In everyday life
Look for How to Design Programs outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “How to Design Programs” →

How to study How to Design Programs in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what How to Design Programs means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain How to Design Programs out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is How to Design Programs in simple terms?

How to Design Programs (HtDP) is a textbook by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi on the systematic design of computer programs. MIT Press published the first edition in 2001 and the second edition in 2018.

Why does How to Design Programs matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study How to Design Programs?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on How to Design Programs.

Tags

  • 2001 non-fiction books
  • Computer programming books
  • Computer science books
  • Creative Commons-licensed books
  • MIT Press books
  • Scheme (programming language)

Keep exploring