出版社: The MIT Press
副标题: An Introduction to Programming and Computing
出版年: 2001212
页数: 720
定价: 71.00美元
装帧: 精装
ISBN: 9780262062183
内容简介 · · · · · ·
This introduction to programming places computer science in the core of a liberal arts education. Unlike other introductory books, it focuses on the program design process. This approach fosters a variety of skillscritical reading, analytical thinking, creative synthesis, and attention to detailthat are important for everyone, not just future computer programmers.
The book ...
This introduction to programming places computer science in the core of a liberal arts education. Unlike other introductory books, it focuses on the program design process. This approach fosters a variety of skillscritical reading, analytical thinking, creative synthesis, and attention to detailthat are important for everyone, not just future computer programmers.
The book exposes readers to two fundamentally new ideas. First, it presents program design guidelines that show the reader how to analyze a problem statement; how to formulate concise goals; how to make up examples; how to develop an outline of the solution, based on the analysis; how to finish the program; and how to test. Each step produces a welldefined intermediate product. Second, the book comes with a novel programming environment, the first one explicitly designed for beginners. The environment grows with the readers as they master the material in the book until it supports a fullfledged language for the whole spectrum of programming tasks.
All the book's support materials are available for free on the Web. The Web site includes the environment, teacher guides, exercises for all levels, solutions, and additional projects.
 amazon.com
豆瓣成员常用的标签(共114个) · · · · · ·
喜欢读"How to Design Programs"的人也喜欢的电子书 · · · · · ·
喜欢读"How to Design Programs"的人也喜欢 · · · · · ·
How to Design Programs的话题 · · · · · · ( 全部 条 )
How to Design Programs的书评 · · · · · · ( 全部 5 条 )
很棒的书，但不适合自学萌新
> 更多书评5篇

Elder Ryan (Wubba lubba dub dub !)
The functions we have developed so far fall into two broad categories. On one hand, we have the category of functions that encapsulate domain knowledge. On the other hand, we have functions that consume structured data. These functions typically decompose their arguments into their immediate structural components and then process those components. If one of the immediate components belongs to...20130306 13:54
The algorithms is functions based on generative recursion.The functions we have developed so far fall into two broad categories. On one hand, we have the category of functions that encapsulate domain knowledge. On the other hand, we have functions that consume structured data. These functions typically decompose their arguments into their immediate structural components and then process those components. If one of the immediate components belongs to the same class of data as the input, the function is recursive. For that reason, we refer to these functions as (STRUCTURALLY) RECURSIVE FUNCTIONS. In some cases, however, we also need functions based on a different form of recursion, namely, generative recursion. The study of this form of recursion is as old as mathematics and is often called the study of ALGORITHMS. Designing an algorithm distinguishes two kinds of problems: those that are TRIVIALLY SOLVABLE54 and those that are not. If a given problem is trivially solvable, an algorithm produces the matching solution. For example, the problem of getting from our home to a nearby airport might be trivially solvable. We can drive there, take a cab, or ask a friend to drop us off. If not, the algorithm generates a new problem and solves those new problems. A multistage trip is an example of a problem that is nontrivial and can be solved by generating new, smaller problems. In a computational setting one of the smaller problems often belongs to the same class of problems as the original one, and it is for this reason that we call the approach GENERATIVE RECURSION. In this part of the book, we study the design of algorithms, that is, functions based on generative recursion.
回应 20130306 13:54 
Elder Ryan (Wubba lubba dub dub !)
Syntax of lambda A lambdaexpression is just a new form of expression: <exp> = (lambda (<var> ... <var>) <exp>) Here are three useful examples: /代码内容已省略/ Scope and Semantics of lambda As discussed in the introduction, a lambdaexpression is just a shorthand for a localexpression. In general, we can think of (l...20130305 14:47
Here are three useful examples:Syntax of lambda A lambdaexpression is just a new form of expression: <exp> = (lambda (<var> ... <var>) <exp>)
(lambda (x c) (> (* x x) c)) (lambda (ir p) (< (irprice ir) p)) (lambda (ir p) (symbol=? (irname ir) p))
Scope and Semantics of lambdaAs discussed in the introduction, a lambdaexpression is just a shorthand for a localexpression. In general, we can think of (lambda (x1 ... xn) exp) as (local ((define (anewname x1 ... xn) exp)) anewname)
Guideline on Lambda Expressions Use lambdaexpressions when a function is not recursive and is only needed once in an argument position.
回应 20130305 14:47 
Elder Ryan (Wubba lubba dub dub !)
/代码内容已省略/ /代码内容已省略/20130305 14:19
def1 ... defn E[(local ((define (f1 x) exp1) ... (define (fn x) expn)) exp)] = def1 ... defn (define (f1' x) exp1') ... (define (fn' x) expn') E[exp']
;; sort : listofnumbers > listofnumbers (define (sort alon) (cond [(empty? alon) empty] [(cons? alon) (insert (first alon) (sort (rest alon)))])) ;; insert : number listofnumbers (sorted) > listofnumbers (define (insert an alon) (cond [(empty? alon) (list an)] [else (cond [(> an (first alon)) (cons an alon)] [else (cons (first alon) (insert an (rest alon)))])]))
回应 20130305 14:19 
Elder Ryan (Wubba lubba dub dub !)
Lists and natural numbers are two classes of data whose description requires selfreferential data definitions. Both data definitions consist of two clauses; both have a single selfreference. Many interesting classes of data, however, require more complex definitions than that. Indeed, there is no end to the variations. It is therefore necessary to learn how to formulate data definitions on our ...20130305 13:31
Lists and natural numbers are two classes of data whose description requires selfreferential data definitions. Both data definitions consist of two clauses; both have a single selfreference. Many interesting classes of data, however, require more complex definitions than that. Indeed, there is no end to the variations. It is therefore necessary to learn how to formulate data definitions on our own, starting with informal descriptions of information. Once we have those, we can just follow a slightly modified design recipe for selfreferential data definitions.
A binarytree (short: BT) is either false; or (makenode soc pn lft rgt) where soc is a number, pn is a symbol, and lft and rgt are BTs.
(makenode 15 'd false (makenode 24 'i false false))
回应 20130305 13:31

硅胶鱼 (才没有拖延症!人家只是惰性求值!)
Pragmatics of "local": 1.Encapsulate a collection of fuction 2.The dualuse of the natural recursion is best expressed with a localexpression.(because the localexpression can compute the dualuse in one time ?).The nested localexpression gives a name to the result of the natural recursion.20110207 00:30
Pragmatics of "local":1.Encapsulate a collection of fuction2.The dualuse of the natural recursion is best expressed with a localexpression.(because the localexpression can compute the dualuse in one time ?).The nested localexpression gives a name to the result of the natural recursion.回应 20110207 00:30 
硅胶鱼 (才没有拖延症!人家只是惰性求值!)
In contrast to lists, structures deal with value extractions as a constant time operation. In general, what we really wish to have in a programming language is: 1.a class of compound values size with constant lookup time, 2.based on ``keys.'' Because the problem is so common, Scheme and most other languages offer at least one builtin solution. in scheme,it is vectors: 下标从0开始！ ...20110220 14:09
In contrast to lists, structures deal with value extractions as a constant time operation.
in scheme,it is vectors:下标从0开始！In general, what we really wish to have in a programming language is: 1.a class of compound values size with constant lookup time, 2.based on ``keys.'' Because the problem is so common, Scheme and most other languages offer at least one builtin solution.
DrScheme also provides a vector analogue to buildlist. It is called buildvector. Here is how it works: 1.(buildvector N f) = (vector (f 0) ... (f ( N 1))) That is, buildvector consumes a natural number N and a function f on natural numbers. It then builds a vector of N items by applying f to 0, ..., N1. The operation vectorref extracts a value from a vector in constant time, that is, for i between 0 and n (inclusive): 2.(vectorref (vector V0 ... Vn) i) = Vi In short, extracting values from a vector is O(1). If vectorref is applied to a vector and a natural number that is smaller than 0 or larger than n, vectorref signals an error. The operation vectorlength produces the number of items in a vector: 3.(vectorlength (vector V0 ... Vn)) = (+ n 1) The operation vector? is the vectorpredicate: 4.(vector? (vector V0 ... Vn)) = true (vector? U) = false if U is a value that isn't created with vector.
回应 20110220 14:09 
硅胶鱼 (才没有拖延症!人家只是惰性求值!)
/代码内容已省略/ 虽然set！操作在local里，但是影响还是全局的，x都变5了 (begin <exp1> <exp2> ... <expn>): A beginexpression consists of the keyword begin followed by a sequence of n + 1 expressions. The evaluation determines the values of all expressions, in order, and then throws away the first n. The value of the last expression is the v...20110222 11:45
(define x 3) (local ((define z (set! x (+ x 2)))) x)
虽然set！操作在local里，但是影响还是全局的，x都变5了(begin <exp1> <exp2> ... <expn>):A beginexpression consists of the keyword begin followed by a sequence of n + 1 expressions. The evaluation determines the values of all expressions, in order, and then throws away the first n. The value of the last expression is the value of the entire beginexpression.(define x 3) (define y 5) (define (swapxy x0 y0) (begin (set! x y0) (set! y x0))) (swapxy 3 5)
交换了x和y：>x5 >y3(define (f x y) (begin (set! x y) y))
set!: expected a defined name after `set!', but found a function argument namex is not defined!!!!(define x 3) (define (increasex) (begin (set! x (+ x 1)) x)) (increasex) (increasex)
the x after `set!' is the x that defined out of the function!回应 20110222 11:45 
硅胶鱼 (才没有拖延症!人家只是惰性求值!)
Grammar of Advanced Student Scheme: <vdf>= (define <var> <val>)  (define <var> <exp>);定义函数语法糖  (definestruct <var> (<var> ...<var>)) <val>= <con>  <lst>  <prm>  <fun>  <void> <lst>= empty  (cons <val> <lst>) <fun>= (lambda (<var> ...<var>..;.20110225 17:40
Grammar of Advanced Student Scheme:
In Advanced Student Scheme:1.In a lambdaexpression no variable may occur twice in the parameter sequence.2.In a localexpression no definition may introduce the same variable as any other definition in the same sequence.3.A set!expression must occur in the lexical scope of a define that introduces the set!expression's lefthand side. Evaluate Order:<vdf>= (define <var> <val>)  (define <var> <exp>);定义函数语法糖  (definestruct <var> (<var> ...<var>)) <val>= <con>  <lst>  <prm>  <fun>  <void> <lst>= empty  (cons <val> <lst>) <fun>= (lambda (<var> ...<var>) <exp>) <exp>= <var>  <con>  <prm>  (<exp> <exp> ...<exp>)  (cond (<exp> <exp>) ...(<exp> <exp>))  (cond (<exp> <exp>) ...(else <exp>))  (local (<def> ...<def>) <exp>)  (lambda (<var> ...<var>) <exp>)  (set! <var> <exp>)  (begin <exp> ...<exp>)
A function defined in a localexpression is different from a function whose body contains a localexpression. The first ensures that some definitions are accessible only to a function. The definition exists once and only once for this function:We rewrite subexpressions in a lefttoright and toptobottom order. At each stage in the evaluation, we best start by underlining the subexpression that must be evaluated next.
(define increase (local ((define index 0)) (lambda() (begin (set! index (+ 1 index)) index)))) (increase) ;value: 1 (increase) ;value: 2 (increase) ;value: 3
The second creates a new (toplevel) definition for every evaluation of the function body. In the next part of the book, we exploit both ideas to create new kinds of programs:(define increase (lambda() (local ((define index 0)) (begin (set! index (+ 1 index)) index)))) (increase) ;value: 1 (increase) ;value: 1 (increase) ;value: 1 (increase) ;value: 1
回应 20110225 17:40

Elder Ryan (Wubba lubba dub dub !)
The functions we have developed so far fall into two broad categories. On one hand, we have the category of functions that encapsulate domain knowledge. On the other hand, we have functions that consume structured data. These functions typically decompose their arguments into their immediate structural components and then process those components. If one of the immediate components belongs to...20130306 13:54
The algorithms is functions based on generative recursion.The functions we have developed so far fall into two broad categories. On one hand, we have the category of functions that encapsulate domain knowledge. On the other hand, we have functions that consume structured data. These functions typically decompose their arguments into their immediate structural components and then process those components. If one of the immediate components belongs to the same class of data as the input, the function is recursive. For that reason, we refer to these functions as (STRUCTURALLY) RECURSIVE FUNCTIONS. In some cases, however, we also need functions based on a different form of recursion, namely, generative recursion. The study of this form of recursion is as old as mathematics and is often called the study of ALGORITHMS. Designing an algorithm distinguishes two kinds of problems: those that are TRIVIALLY SOLVABLE54 and those that are not. If a given problem is trivially solvable, an algorithm produces the matching solution. For example, the problem of getting from our home to a nearby airport might be trivially solvable. We can drive there, take a cab, or ask a friend to drop us off. If not, the algorithm generates a new problem and solves those new problems. A multistage trip is an example of a problem that is nontrivial and can be solved by generating new, smaller problems. In a computational setting one of the smaller problems often belongs to the same class of problems as the original one, and it is for this reason that we call the approach GENERATIVE RECURSION. In this part of the book, we study the design of algorithms, that is, functions based on generative recursion.
回应 20130306 13:54 
Elder Ryan (Wubba lubba dub dub !)
Syntax of lambda A lambdaexpression is just a new form of expression: <exp> = (lambda (<var> ... <var>) <exp>) Here are three useful examples: /代码内容已省略/ Scope and Semantics of lambda As discussed in the introduction, a lambdaexpression is just a shorthand for a localexpression. In general, we can think of (l...20130305 14:47
Here are three useful examples:Syntax of lambda A lambdaexpression is just a new form of expression: <exp> = (lambda (<var> ... <var>) <exp>)
(lambda (x c) (> (* x x) c)) (lambda (ir p) (< (irprice ir) p)) (lambda (ir p) (symbol=? (irname ir) p))
Scope and Semantics of lambdaAs discussed in the introduction, a lambdaexpression is just a shorthand for a localexpression. In general, we can think of (lambda (x1 ... xn) exp) as (local ((define (anewname x1 ... xn) exp)) anewname)
Guideline on Lambda Expressions Use lambdaexpressions when a function is not recursive and is only needed once in an argument position.
回应 20130305 14:47 
Elder Ryan (Wubba lubba dub dub !)
/代码内容已省略/ /代码内容已省略/20130305 14:19
def1 ... defn E[(local ((define (f1 x) exp1) ... (define (fn x) expn)) exp)] = def1 ... defn (define (f1' x) exp1') ... (define (fn' x) expn') E[exp']
;; sort : listofnumbers > listofnumbers (define (sort alon) (cond [(empty? alon) empty] [(cons? alon) (insert (first alon) (sort (rest alon)))])) ;; insert : number listofnumbers (sorted) > listofnumbers (define (insert an alon) (cond [(empty? alon) (list an)] [else (cond [(> an (first alon)) (cons an alon)] [else (cons (first alon) (insert an (rest alon)))])]))
回应 20130305 14:19 
Elder Ryan (Wubba lubba dub dub !)
Lists and natural numbers are two classes of data whose description requires selfreferential data definitions. Both data definitions consist of two clauses; both have a single selfreference. Many interesting classes of data, however, require more complex definitions than that. Indeed, there is no end to the variations. It is therefore necessary to learn how to formulate data definitions on our ...20130305 13:31
Lists and natural numbers are two classes of data whose description requires selfreferential data definitions. Both data definitions consist of two clauses; both have a single selfreference. Many interesting classes of data, however, require more complex definitions than that. Indeed, there is no end to the variations. It is therefore necessary to learn how to formulate data definitions on our own, starting with informal descriptions of information. Once we have those, we can just follow a slightly modified design recipe for selfreferential data definitions.
A binarytree (short: BT) is either false; or (makenode soc pn lft rgt) where soc is a number, pn is a symbol, and lft and rgt are BTs.
(makenode 15 'd false (makenode 24 'i false false))
回应 20130305 13:31
论坛 · · · · · ·
HTDP的教学网站  来自Complexity  20100624 
以下豆列推荐 · · · · · · ( 全部 )
 程序员必读经典书籍 (Felven)
 拓展编程视界系列 (AlbertLee)
 只推荐给高智商者的书单人一生需要读的最少且必要的非专业书 (Daro)
 要用十年时间通读计算机科学图书 (藏藏藏)
 研究生读书计划计算机基础 (衫秋南)
谁读这本书?
二手市场
订阅关于How to Design Programs的评论:
feed: rss 2.0
1 有用 谷幽😷 20100917
用Racket写代码真是太舒服了，第一次接触函数式编程。
1 有用 r2g2 20140928
htdp.org
2 有用 一寸行者 20130519
我看的是还已完成的第二版和第二版中未完成内容的第一版。太啰嗦，这点是对零基础很友好。但是对于“函数式思维”，这本书只能算是 scheme/racket 的索引。此外编码习惯非常好。
0 有用 Duke 20180429
额。。。买了之后才想到拿出来看。。。结果发现已经没有看的意义了= =，小学生如果不学pascal而是有htdp学该多好
2 有用 魏小兴 20130315
想看SICP的话，可以先读读这本书，做做练习，比SICP简单许多。这本书是免费公开的，而且第二版已经写了很多了，用Racket来描述。想写SICP上的程序，可以先读这本，把Racket熟悉一下
1 有用 这个需求做不了 20190106
挺好的
0 有用 ruandao 20181012
教你编程素养，怎么去设计编程 主要有，面向信息编程和数据是有状态的
0 有用 qin 20180519
经典教科书，作者亲自授课，可惜我分数很低。。
0 有用 王金雷 20171116
sicp的初级版
0 有用 鼎先生 20171009
相对于sicp显得太啰嗦