出版社: 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
豆瓣成员常用的标签(共103个) · · · · · ·
喜欢读"How to Design Programs"的人也喜欢的电子书 · · · · · ·
喜欢读"How to Design Programs"的人也喜欢 · · · · · ·
How to Design Programs的书评 · · · · · · (全部 8 条)
真正讲程序设计方法，讲思想
> 更多书评8篇

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 
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 
/代码内容已省略/ /代码内容已省略/
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 
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

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 
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 
/代码内容已省略/ /代码内容已省略/
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 
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 
这本书的其他版本 · · · · · · ( 全部2 )
 人民邮电出版社版 200312 / 70人读过
以下豆列推荐 · · · · · · ( 全部 )
 程序员必读经典书籍 (Felven)
 Lisp书不要钱 (哗呀哩呜)
 BT程序员之路 (AlbertLee)
 拓展编程视界系列 (AlbertLee)
 只推荐给高智商者的书单人一生需要读的最少且必要的非专业书 (Daro)
谁读这本书?
二手市场
 > 点这儿转让 有954人想读,手里有一本闲着?
订阅关于How to Design Programs的评论:
feed: rss 2.0
0 有用 波多野丽猪 20110707
好书好书好书！！！！
2 有用 魏小兴 20130315
想看SICP的话，可以先读读这本书，做做练习，比SICP简单许多。这本书是免费公开的，而且第二版已经写了很多了，用Racket来描述。想写SICP上的程序，可以先读这本，把Racket熟悉一下
0 有用 unlockingman 20121021
Our textbook, problem solving skills
3 有用 codepiano 20141104
更像一本用lisp方言给不会编程的人入门函数式编程的书
1 有用 r2g2 20140928
htdp.org
0 有用 Maxine 20170324
https://github.com/adaliugh/htdp (>link to my solutions). It took me 3 months to finish this book (2ed). I used HTDP as a stepstone for SICP and found it very FRIENDLY (a little verbose) to BEGINNERS (like me). It teaches people how to design programs (including data abstraction and function abstraction) STEP BY STEP. Highly recommended!!!
0 有用 安雪仁次 20161203
学习编程要从lisp/scheme开始。对初学者来说，掌握计算的法则远比通晓语言特性重要。这本书阅读起来毫无压力，讲解又极为透彻，实在是太难得了。
0 有用 [已注销] 20160520
循循善诱的书，内容涵盖了sicp前三章的几乎所有内容，作者精心准备的design recipe估计会让大多数读者受益。
0 有用 dfm1212 20151106
看完了前两章(后面章节翻过去的)，觉得没必要再看下去，直接上SICP。
1 有用 Tung CHENG 20151113
第二版，在线阅读。