''How to Design Programs'' (''HtDP'') is a textbook by
Matthias Felleisen
Matthias Felleisen is a German-American computer science professor and author. He grew up in Germany and immigrated to the US when he was 21 years old.
He received his PhD from Indiana University under the direction of Daniel P. Friedman.
Afte ...
,
Robert Bruce Findler
Robert Bruce Findler, colloquially known as "Robby", is an American computer scientist, currently, a professor of computer science at Northwestern University. He is also a member of the PLT group and, as such, responsible for the creation and main ...
,
Matthew Flatt Matthew Flatt is an American computer scientist and professor at the University of Utah School of Computing in Salt Lake City. He is also a member of the core development team for the Racket programming language.
Flatt received his PhD at Rice Univ ...
, and
Shriram Krishnamurthi
Shriram Krishnamurthi is a computer scientist, currently a professor of computer science at Brown University and a member of the core development group for the Racket programming languages, responsible for creation of software packages including ...
on the systematic design of
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer program ...
s.
MIT Press
The MIT Press is a university press affiliated with the Massachusetts Institute of Technology (MIT) in Cambridge, Massachusetts (United States). It was established in 1962.
History
The MIT Press traces its origins back to 1926 when MIT publish ...
published the first edition in 2001, and the second edition in 2018, which is freely available online and in print. The book introduces the concept of a ''design recipe'', a six-step process for creating programs from a problem statement. While the book was originally used along with the education project ''TeachScheme!'' (renamed
ProgramByDesign
The ProgramByDesign (formerly TeachScheme!) project is an outreach effort of the PLT research group. The goal is to train college faculty, high school teachers, and possibly even middle school teachers, in programming and computing.
History
Matt ...
), it has been adopted at many colleges and universities for teaching program design principles.
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
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted ...
that the desired program consumes and produces. The structure of these data descriptions determines the organization of the program.
Then, the book carefully 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, thus enabling a programmer who encounters a new form of data to still construct a program systematically.
Like ''
Structure and Interpretation of Computer Programs
''Structure and Interpretation of Computer Programs'' (''SICP'') is a computer science textbook by Massachusetts Institute of Technology professors Harold Abelson and Gerald Jay Sussman with Julie Sussman. It is known as the "Wizard Book" in hac ...
'' (SICP), HtDP relies on a variant of the programming language
Scheme A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
. It includes its own programming
integrated development environment
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
(IDE), named
DrRacket
Racket is a general-purpose, multi-paradigm programming language and a multi-platform distribution that includes the Racket language, compiler, large standard library, IDE, development tools, and a set of additional languages including Typed Ra ...
, 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
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declar ...
languages.
Pedagogical basis
In the 2004 paper, The Structure and Interpretation of the Computer Science Curriculum,
[ a paper in which the authors compare and contrast HtDP with SICP.] the same authors compared and contrasted the pedagogical focus of ''How to Design Programs'' (HtDP) with that of ''
Structure and Interpretation of Computer Programs
''Structure and Interpretation of Computer Programs'' (''SICP'') is a computer science textbook by Massachusetts Institute of Technology professors Harold Abelson and Gerald Jay Sussman with Julie Sussman. It is known as the "Wizard Book" in hac ...
'' (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
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, e ...
curriculum. It then describes the principles of teaching behind HtDP; in particular, the difference between implicit vs. explicit teaching of design principles. It then continues on to describe the role of
Scheme A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
and the importance of an ideal
programming environment, and concludes with an extensive evaluation of content and student/faculty reaction to experience with SICP vs. HtDP.
One of the major focuses of the paper is the emphasis on the difference in required
domain knowledge
Domain knowledge is knowledge of a specific, specialized discipline or field, in contrast to general (or domain-independent) knowledge. The term is often used in reference to a more general discipline—for example, in describing a software engin ...
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 considerably more sophisticated domain knowledge than those of HtDP. The paper continues on to explain why this difference in required domain knowledge has resulted in certain students having confused domain knowledge with program design knowledge.
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 then distinguishes between structural
recursion
Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics ...
, where the related data definition happens to be
self-referential
Self-reference occurs in natural or formal languages when a sentence, idea or formula refers to itself. The reference may be expressed either directly—through some intermediate sentence or formula—or by means of some encoding. In philosop ...
, 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
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pro ...
(OO) world.
Finally, the paper concludes with a description of responses from various faculty and students after having used HtDP in the classroom.
References
External links
* , 2018 2nd edition, 2003 1st edition
A critique of Abelson and Sussman - or - Why calculating is better than scheming{{Lisp programming language
2001 non-fiction books
Computer science books
MIT Press books
Computer programming
Scheme (programming language)