天天看點

程式員沒有真實讀的書(Books Programmers Don't Really Read)

最常被程式員們謊稱讀過的計算機書籍

中文翻譯:http://www.billthelizard.com/2008/12/books-programmers-dont-really-read.html

馬克·吐溫曾經說過,所謂經典小說,就是指很多人希望讀過,但很少人真正花時間去讀的小說。這種說法同樣适用于“經典”的計算機書籍。

在Stack Overflow(以及其它很多軟體論壇)上,諸如”程式員最應該讀的計算機書籍有哪些?“這樣的問題會周期性的出現。這樣的問題不斷的被提出、被回答,隻是形式不同罷了。相同的幾本書總是會出現在清單的前幾名内,是以,如果想知道人們談論的都是些什麼,你有必要去讀一讀這些書的。

大多數程式員真正讀過的計算機書籍

  1. 代碼大全(Code Complete)——兩屆Software Jolt Award震撼大獎得主!
  2. 程式員修煉之道(The Pragmatic Programmer)
  3. C程式設計語言( C Programming Language)(第2版)
  4. 重構:改善既有代碼的設計(Refactoring: Improving the Design of Existing Code)
  5. 人月神話(The Mythical Man-Month)
  6. 編碼——隐匿在計算機軟硬體背後的語言(Code: The Hidden Language of Computer Hardware and Software)
  7. Head First 設計模式(Head First Design Patterns)
  8. 程式設計珠玑(Programming Pearls)
  9. Effective Java中文版(Effective Java (2nd Edition))or Effective C++(第三版)中文版
  10. Test Driven Development: By Example

上面的這些書我自己都讀過,是以我不難相信很多不是很優秀的程式員也都讀過它們。如果你對程式設計有足夠的興趣,能夠來到這裡讀這篇部落格,你很可能讀過其中的大部分,甚至還有很多不在這個清單中的,是以我就不浪費時間每本書都評論一番了。我想說的是,這個清單上的每本書都是它各自領域裡的奇書。是以,很多有願望不斷提高自己的程式設計技術的程式員都讀過這些書,這就不足為怪了。

在人們備受推崇的計算機書籍中,還有一類書受到了獨特的待遇。我稱下面這個清單為“最常被程式員們謊稱讀過的計算機書籍”。這并不是說推薦這些書的人都沒有真正讀過它們。我隻是有相當的信心懷疑更多的人隻是在口頭上宣稱讀過下列書籍,而實際上很少人真正讀過它們。下面就是這個清單。

最常被程式員們謊稱讀過的計算機書籍

  1. 算法導論(Introduction to Algorithms)(CLRS)這本書的名稱是所有出版過的計算機書籍中最讓人誤解一個。它被廣泛的使用在很多大學裡,通常被當作畢業生必需的算法課程。于是,隻要在大學裡上過計算機課程的學生幾乎都有一本這樣的書。然而,除非你擁有計算機碩士學位(而且是算法研究領域的),我懷疑你頂多隻讀過算法導論(Introduction to Algorithms)裡節選的幾章内容。這個書名讓人誤解,是因為”Introduction”這個詞讓人以為它很适合初級程式員。實際上不是。這本書對算法做盡可能詳盡綜合的介紹,就像其它一些随處可見的類似的書一樣。請不要再把這本書推薦給初學者。
  2. 編譯原理(Compilers: Principles, Techniques, and Tools)(the Dragon Book).這本恐龍封面的書涵蓋了開發一個編譯器你所需要的全部的知識。它的内容包括詞彙分析,文法分析,類型檢查,代碼優化,以及其它很多高深的題目。請不要把這本書推薦給初級程式員,他們需要的隻是分析簡單的包含數學公式或HTML的字元串。除非你真的需要實作一個能夠實用的編譯器(或解釋器),你根本不需要掌握這本“恐龍”書的全部強大威力。把它推薦給一個遇到簡單文本分析問題的人,這證明你根本沒有讀過它。
  3. 計算機程式設計藝術(The Art of Computer Programming)(TAOCP)我經常聽到人們把這本書描述為“每個程式員必讀”的系列計算機書籍。我認為這明顯不是實情。在我說出這樣大不敬的話、被你們用闆磚拍死之前,請讓我做解釋一下。這不是一本讓你一頁一頁翻着讀的書。這是一本參考大全書。把它放在你的書架上看起來會很不錯(實際上也它确實很好),但如果想把它通讀一遍,你需要幾年時間,而且最後什麼都沒記住。這并不是說手邊放這樣一本書沒有什麼價值。它是一本參考書,當我遇到難題,走投無路時,很多次我都在這本書裡找到辦法。但這本書終究是被我當作參考書。它複雜難懂,很理論,裡面的例子都是彙編語言的。好的一面是,如果你想在這本書裡尋找針對某一問題的解決方案,如果你找不到,那就說明這個問題無解。它是一本對它所涉及到的領域做了最最詳盡介紹的一本書。
  4. Design Patterns: Elements of Reusable Object-Oriented Software(Gang of Four)這本書是唯一一本在這個清單裡我從頭到尾讀過的書,讀的結果是,我不知道該把這本書歸到哪個類别。它出現在這個清單裡,并不是因為我認為隻有很少人真正讀過它。很多人都讀過。隻是因為有更多推薦過這本書的人自己卻沒有讀過。Design Patterns這邊書的問題在于,很多書裡給出的資訊,你在其它很多地方都能看到。這樣就使得一個初學者在維基百科上讀了幾篇關于設計模式的内容後,就敢在面試中宣稱自己看過這本書。這就是為什麼Singleton成了一種新的全局變量的原因。如果有更多的人花時間讀過這本也叫做Gang of Four的書的原著,那世界上就不會有這麼多人會把17種設計模式硬塞到一個日志(logging)架構裡了。這本書最精彩的部分是每章裡描述如何正确的使用一種模式的段落。遺憾的是,這些精華卻在很多其它設計模式資料裡被漏掉了。
  5. C++程式設計語言(The C++ Programming Language)這本書不像一本程式設計教材,更像一本程式設計語言參考。有很多的迹象表明有人确實讀過這本書,否則我們不可能有這麼多的C++ 編譯器可選擇。程式設計初學者(或者甚至其它語言的專家),如果想學C++,不應該直接去啃C++程式設計語言(The C++ Programming Language)這本書。告訴他們去讀《C++ Primer中文版》。

正如我之前說的,我知道你們當中會有一些人真正的讀過這些書。那這篇文章不是針對你的,針對的是那些企圖通過假裝讀過這些書來表現自己的群眾。 如果你自己沒有讀過這些計算機書籍,請不要推薦給别人。這樣做會耽誤别人的時間,誤人子弟,因為一些閱曆更豐富的人可能會有更好的書(更針對某一領域,更容易了解,跟某種程式設計語言或某種程式設計水準更契合的書)來推薦。除此之外,你也能避免被那些真正讀過計算機程式設計藝術(The Art of Computer Programming)的人用MMIX知識給拷問住造成的尴尬(如果你不知道我在說什麼,那我指的就是你)。

[本文英文原文連結:Books Programmers Claim to Have Read ]

英文原著:http://www.billthelizard.com/2008/12/books-programmers-dont-really-read.html

Books Programmers Don't Really Read

Mark Twain once said that a classic novel is one that many people want to have read, but few want to take the time to actually read. The same could be said of "classic" programming books.

Periodically over on Stack Overflow (and in many other programming forums) the question comes up about what books are good for programmers to read. The question has been asked and answered several times, in several different ways. The same group of books always seems to rise to the top, so it's worth it to take a look at these books to see what everyone is talking about.

Disclosure: All of the links in the following lists are Amazon affiliate links. If you're opposed to me making a few cents off this blog, but you're interested in any of these books, they're easy enough to find by searching Google for the individual titles.

Books Most Programmers Have Actually Read

   1. Code Complete

   2. The Pragmatic Programmer

   3. C Programming Language (2nd Edition)

   4. Refactoring: Improving the Design of Existing Code

   5. The Mythical Man-Month

   6. Code: The Hidden Language of Computer Hardware and Software

   7. Head First Design Patterns

   8. Programming Pearls

   9. Effective Java (2nd Edition)

      or Effective C++

  10. Test Driven Development: By Example

I've read all of these books myself, so I have no difficulty believing that any moderately competent programmer has read them as well. If you're interested enough in programming that you're reading this blog, you've probably read most, if not all, of the books in this list. For this reason, I won't spend time reviewing each one individually. I'll just say that each of the books on the list in an exceptional book on its respective topic. There's a good reason that most software developers who are interested in improving their skills have read most of these books.

Among the most commonly recommended programming books there is another group that deserves special consideration. I call the next list "Books Programmers Claim to Have Read". This isn't to say that no one who recommends these books has actually read them. I just have reason to suspect that a lot more people claim to have read the following books than have actually read them. Here's the list.

Books Programmers Claim to Have Read

   1. Introduction to Algorithms (CLRS)

      This book may have the most misleading title of any programming book ever published. It's widely used at many universities, usually in graduate level algorithms courses. As a result, any programmer who has taken an algorithms course at university probably owns a copy of CLRS. However, unless you have at least a Masters degree in Computer Science (and in Algorithms specifically), I doubt you've read more than a few selected chapters from Introduction to Algorithms.

      The title is misleading because the word "Introduction" leads one to believe that the book is a good choice for beginning programmers. It isn't. The book is as comprehensive a guide to algorithms as you are likely to find anywhere. Please stop recommending it to beginners.

   2. Compilers: Principles, Techniques, and Tools (the Dragon Book).

      The Dragon Book covers everything you need to know to write a compiler. It covers lexical analysis, syntax analysis, type checking, code optimization, and many other advanced topics. Please stop recommending it to beginning programers who need to parse a simple string that contains a mathematical formula, or HTML. Unless you actually need to implement a working compiler (or interpreter), you probably don't need to bring the entire force of the Dragon to bear. Recommending it to someone who has a simple text parsing problem proves you haven't read it.

   3. The Art of Computer Programming (TAOCP)

      I often hear TAOCP described as the series of programming books "that every programmer should read." I think this is simply untrue. Before I'm burned at the stake for blasphemy, allow me to explain. TAOCP was not written to be read from cover to cover. It's a reference set. It looks impressive (it is impressive) sitting on your shelf, but it would take several years to read it through with any kind of retention rate at all.

      That's not to say that it's not worthwhile to have a copy of TAOCP handy as a reference. I've used my set several times when I was stuck and couldn't find help anywhere else. But TAOCP is always my reference of last resort. It's very dense and academic, and the examples are all in assembly language. On the positive side, if you're looking for the solution to a problem in TAOCP (and the appropriate volume has been published) and you can't find it, the solution probably doesn't exist. It's extremely comprehensive over the topic areas that it covers.

   4. Design Patterns: Elements of Reusable Object-Oriented Software (Gang of Four)

      Design Patterns is the only book on this list I've personally read from cover to cover, and as a result I had a hard time deciding which list it belongs on. It's on this list not because I think that few people have read this book. Many have read it, it's just that a lot more people claim to have read it than have actually read it.

      The problem with Design Patterns is that much of the information in the book (but not enough of it) is accessible elsewhere. That makes it easy for beginners to read about a few patterns on Wikipedia, then claim in a job interview that they've read the book. This is why Singleton is the new global variable. If more people took the time to read the original Gang of Four, you'd see fewer people trying to cram 17 patterns into a logging framework. The very best part of the GoF book is the section in each chapter that explains when it is appropriate to use a pattern. This wisdom is sadly missing from many of the other sources of design pattern lore.

   5. The C++ Programming Language

      This book is more of a language reference than a programming guide. There's certainly plenty of evidence that someone has read this book, since otherwise we wouldn't have so many C++ compilers to choose from.

      Beginning programmers (or even experts in other languages) who want to learn C++, though, should not be directed to The C++ Programming Language. Tell them to read C++ Primer instead.

As I said before, I know there are a few of you who have actually read these books. This post isn't intended for you, it's intended for the multitudes who are trying to appear smarter by pretending to have read them. Please stop recommending books to others that you haven't read yourself. It's counter productive, as often there is a better book (more focused on a specific problem domain, easier to understand, geared more toward a specific programming language or programming skill level) that someone more knowledgeable could recommend. Besides that, you may end up embarrassing yourself when someone who has actually read TAOCP decides to give you a MMIX pop quiz (if you don't know what I'm talking about, then this means you).

繼續閱讀