How to Design Programs
From Wikipedia, the free encyclopedia
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 from MIT Press. The book introduces the concept of a design recipe, a six-step process for creating programs from the problem statement. The process starts with a careful analysis of the 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.
The book therefore carefully introduces more and more complex kinds of data, which sets it apart from every other introductory programming book. It starts from atomic forms of data and then progresses to compound forms of data, including data that can be arbitrarily large. For each kind of data definition, the book explains how to organize the program in principle, thus enabling a programmer who encounters a new form of data to still construct a program systematically.
Like Structure and Interpretation of Computer Programs, HTDP relies on a variant of the Scheme programming language. Indeed, it comes with its own programming environment, dubbed DrScheme, 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 previous one. With the exception of the largest teaching language, all languages for HtDP are functional programming languages.