My favorite Computer Science books, and why

My favorite Computer Science books, and why

我最喜爱的计算机科学书籍及其推荐理由

The Art of Computer Programming. Donald E. Knuth. Addison-Wesley, 1997/2011. Often cited, but rarely read. It’s really a shame, for these books are incredibly rich. Numerous jewels are hidden everywhere, sometimes inside exercise solutions (and there are many exercises). It is dense, obviously, and it may take a lot of time to digest a single page. But you will never waste your time doing this. Those who stop at the presence of assembly code are missing the point.

《计算机程序设计艺术》(The Art of Computer Programming)。Donald E. Knuth 著。Addison-Wesley 出版社,1997/2011。 这套书常被引用,却鲜有人真正读完。这实在令人遗憾,因为书中的内容极其丰富。无数瑰宝隐藏在各处,有时甚至藏在习题解答中(书中有大量的习题)。显然,这本书非常深奥,消化单单一页内容可能就需要花费大量时间。但你绝不会浪费时间。那些因为书中包含汇编代码而望而却步的人,其实错失了重点。

Algorithms, 4th Edition. Robert Sedgewick, Kevin Wayne. Addison-Wesley, 2011. For me, the best book on algorithms. Beautiful figures and numerous examples. Crystal clear Java code. (The choice of Java for such a book is convincing.) The companion web site provides code, data, and lecture slides. Note: this is the 4th edition; this is important.

《算法》(Algorithms),第四版。Robert Sedgewick, Kevin Wayne 著。Addison-Wesley 出版社,2011。 在我看来,这是关于算法最好的书。书中配有精美的插图和大量的示例,Java 代码清晰易懂。(为这样一本书选择 Java 作为实现语言是非常有说服力的。)配套网站提供了代码、数据和讲义幻灯片。注意:这是第四版,这一点很重要。

The Practice of Programming. Brian W. Kernighan, Rob Pike. Addison-Wesley, 1999. This book is worth buying, even if only for the last three pages, where the programming rules discussed in the book are collected. We should have the students learn these rules by heart; we should apply these rules ourselves. This book provides an outstanding insight on programming. There is an implicit message: the choice of programming language is not as important as one may think.

《程序设计实践》(The Practice of Programming)。Brian W. Kernighan, Rob Pike 著。Addison-Wesley 出版社,1999。 这本书值得购买,哪怕仅仅是为了最后三页——书中讨论的编程准则都被汇总在那里。我们应该让学生们背诵这些准则,我们也应该在实践中应用它们。这本书对编程提供了卓越的见解。它传达了一个隐含的信息:编程语言的选择并不像人们想象的那么重要。

Computer Systems: A Programmer’s Perspective. Randal E. Bryant, David R. O’Hallaron. Pearson, 2011. Everything programmers should know about hardware, system, compiler, etc., to improve their skills. Likely to be the only book where a whole chapter is devoted to linking. Written by programmers, for programmers.

《深入理解计算机系统》(Computer Systems: A Programmer’s Perspective)。Randal E. Bryant, David R. O’Hallaron 著。Pearson 出版社,2011。 程序员为了提升技能所需要了解的关于硬件、系统、编译器等的一切知识,书中应有尽有。这很可能是唯一一本专门用一整章来讲解“链接”的书。这是由程序员编写,为程序员所写的书。

Purely Functional Data Structures. Chris Okasaki. Cambridge University Press, 1998. First, a book that beautifully explains what are purely functional data structures, their interest, their implementation, and their complexity analysis, notably in presence of amortization and lazy evaluation. Tons of data structures, some being revisited with a lot of elegance. An example: binomial heaps. Crystal clear SML code, explained line by line.

《纯函数式数据结构》(Purely Functional Data Structures)。Chris Okasaki 著。剑桥大学出版社,1998。 首先,这是一本精彩地解释了什么是纯函数式数据结构、它们的意义、实现方式及其复杂度分析的书,特别是在摊还分析和惰性求值方面。书中包含了大量的数据结构,其中一些被以非常优雅的方式重新审视。例如:二项堆。书中提供了清晰的 SML 代码,并逐行进行了解释。

Programming Pearls. Jon Bentley. Addison-Wesley, 1986. Still relevant, more than thirty years later. Plenty of good advice. Perfect style, and perfect examples. Some chapters I liked a lot: Writing Correct Programs, The Back of the Envelope, Sorting, and Heaps. As written in the preface: “This book is written for programmers’’.

《编程珠玑》(Programming Pearls)。Jon Bentley 著。Addison-Wesley 出版社,1986。 三十多年过去了,它依然具有现实意义。书中充满了好的建议,文笔完美,示例经典。我非常喜欢其中的一些章节:编写正确的程序、封底计算、排序和堆。正如序言中所写:“这本书是为程序员而写的。”

Hacker’s Delight. Henry S. Warren. Addison-Wesley, 2003. Tons of arithmetic hacks, all delightful. Some are for fun only (and thus worth reading), but many are genuinely useful. For instance, this book tells you what your compiler is doing when your code divides by a constant. The web site does not exist anymore, but is archived here.

《黑客悦读》(Hacker’s Delight)。Henry S. Warren 著。Addison-Wesley 出版社,2003。 书中包含了大量的算术技巧,非常有趣。有些纯粹是为了好玩(因此也值得一读),但许多技巧确实非常实用。例如,这本书会告诉你当代码中出现除以常数的操作时,编译器到底在做什么。原网站已不存在,但可以在此处找到存档。

Algorithms on Strings, Trees, and Sequences. Dan Gusfield. Cambridge University Press, 1997. Mostly a book on text algorithms, with numerous algorithms beautifully explained (and proved!). There is a whole part on suffix trees, and notably an excellent explanation of Ukkonen algorithm (notoriously difficult to understand and to code). Also contains many applications of these algorithms.

《字符串、树与序列算法》(Algorithms on Strings, Trees, and Sequences)。Dan Gusfield 著。剑桥大学出版社,1997。 这主要是一本关于文本算法的书,书中对大量算法进行了精彩的解释(并给出了证明!)。书中有一整部分专门讲解后缀树,特别是对 Ukkonen 算法(以难以理解和编码著称)给出了极好的解释。此外,书中还包含了这些算法的许多应用。

The Elements of Computing Systems. Noam Nisan, Shimon Schocken. MIT Press, 2008. The best way to understand everything is probably to build everything by oneself. That’s what is proposed in this book, where the reader is invited to build a machine, an assembler, a compiler, and finally an operating system. (Interpreters are provided.) Even if you do not undertake such a construction, the book is worth reading, preferably in one shot. Companion web site: www.nand2tetris.org

《计算的要素》(The Elements of Computing Systems)。Noam Nisan, Shimon Schocken 著。麻省理工学院出版社,2008。 理解一切的最好方法可能就是亲手构建一切。这正是本书所提倡的,读者被邀请去构建一台机器、一个汇编器、一个编译器,最后是一个操作系统。(书中提供了相关的解释器。)即使你不打算进行这样的构建,这本书也值得一读,最好是一气呵成地读完。配套网站:www.nand2tetris.org