FW: 王垠:对TAOCP的真正看法

01/05 10:27
阅读数 168

TAOCP: The Art of Computer Programming

 

王垠:对TAOCP的真正看法

转载 beswkwangbo 发布于2013-11-22 15:02:30 阅读数 2264 收藏
分类专栏: 王垠
收起

本来早就想想写一个对于Knuth的The Art of Computer Programming的看法。
没想到一去Amazon就找到一个同类 :)
 
关于Knuth的 TAOCP,我想,大部分人声称看了他的书,或者买了他的书,不过是作为一种炫耀的资本或者摆设。我对门的同学几年前就买了一套三本,全新的精装本,花了 200多块钱。可是呢,他从来就没看。我把它借过来,看了几页就放在那里没有看了。我哪有时间看他用那些一个字节6位的机器语言实现简单的链表!有一天一个师弟走进来,看到那套书在我书架上,显示出一种敬畏感:“挖!师兄!你好牛啊!居然看这么高深的书!” 我一愣。嗯,不错嘛,这套书放在书架上可以让人对我刮目相看。这恐怕就是它对很多人的实际作用。还有人可以帮助神化这套书,同时也神化自己,比如他可以这么说:“谁要是看完了Don Knuth的 The Art of Computer Programming 我就雇用他!” 这样可以显得比一般看过书的人还要高一等。据说Bill Gates就是这么做的。我怀疑他自己看完过没有。
 
我讨厌这套书的一个原因就是 Knuth故意用一个叫 MIX 的处理器的 机器语言来写这本书。虽然在新版的书里他设计了一种新的处理器 MMIX,但是换汤不换药。他以为一部“永恒”的计算机编程书不应该使用高级语言,因为它们很容易过时。但是他错了,机器语言恰恰是最容易过时的东西,看看现在有多少牌子的更新换代的处理器就知道。而世界上确实存在非常高级的语言从60年代到现在都没有过时。我预言,MMIX会在不久的将来被淘汰。很好笑的是MMIX是在MIX上加了一个“M”,代表Millennium(千禧年)。关于它的专著也起名为 MMIXware---A RISC Computer for the Third Millennium。一千年甚至短短一百年,几十年以后,计算机还是不是二进制的集成电路都说不清楚,况且这个处理器其实就是从别的处理器比如RISC II, Sparc之类的捡了一点东西,没有什么大的创新。他就把这个处理器的模拟程序印在纸上卖,曰:“一个优秀的程序要像一部好的小说一样容易读懂。一个优秀的程序员会在将来拿到普利策奖。”
 
用机器语言写一点初级的计算机入门部分还可以,但是用来写整整一部书未免容易让读者只见树木不见森林了。看TAOCP最容易出现的一种现象就是,“哇!原来这个程序可以这么写。” 但是你不知道为啥那么写。虽然可以知道一些底层的原因,但是最根本的原理,读者始终不会明白。就像看清楚了一张图片上的每一个像素,却认不出图片上其实是一个熟人。看清楚了棋盘上每一个棋子能走的地方,却不能赢棋。Dijkstra 说计算科学不应该被叫做"computer science",就像外科手术不应该叫做"knife science"。可是这关Knuth什么事呢,他的书名叫做 The Art of...
 
我曾经说找到Knuth书里的错误,得到几张支票,受到很大鼓舞。我真的受到鼓舞了吗?我真的从他的书里得到什么新的想法吗?抛开潜意识里想显示一下自己的念头,我得出的结论是:没有。每一个认为自己从这套书得到了什么的人都仔细想一下,到底你的知识,你的新想法是从哪里来的?
 
再说他的支票吧…… 很多人拿了Knuth的支票就作为一种可以炫耀的东西。以前我就看到一个Cambridge的教授主页上挂着一个Knuth支票的照片。Knuth的支票真的可以作为炫耀的资本吗?告诉你们,我找到的错误都是typo而已,没想到他也给我支票。谁叫他打字不小心,Millennium都能打成 Millenium?嘿!我凑足了一顿饭钱的支票时就想去中国银行兑现,准备换了钱大吃一顿。可是银行的职员告诉我,他们必须把支票寄回美国才能拿到现金,办理这件事的费用大大高于支票本身的价值!所以Knuth相当于给我一些空头支票。Damn!早该想到的,他为什么不往大家的信用卡上面转账,而使用支票这种过时的东西!他明显觉得有他签名的支票,肯定谁也不会拿去兑现,甚至装裱在相框里作为纪念。hmmm... 算你狠~
 
好了,啰里啰唆。还是看看这个别人写的书评。White elephant,这确实道出了我对这套书的感觉。 (但是评价者有些观点我不能苟同,比如“O(n)表示法足够了”。) 希望以后对 paper 也有这种公开的 comments!
 
 
 
  BETTER BOOKS EXIST, KNUTH IS NOT GOD, November 12, 2003
Reviewer: A reader

People buy Knuth's books for snob appeal, which is to say that they like to put the 3-book set on their shelves as an advertisement for their own intellegence. What they don't realize is that truly talented individuals will see beyond this kind of cheap PR stunt. "Look, I read Knuth... boy, I must be a genius!"

Donald Knuth obviously has offered extra credit to students who provide him with glowing reviews on amazon. "Oh geeze, this is the best book ever. Bow down and kiss his feet." For all we know, he may even offer a cash reward.

This is just one of those cases where the myth of Knuth has overshadowed reality. Is Knuth well known? Yes. Has Knuth been around forever. Yes. Has knuth published countless articles? Yes. Are his books used in day-to-day coursework at top-ten engineering schools. NO, THEY ARE NOT.

For data structures, most *working* professors would refer you to Cormen, Leiserson, and Rivest (or maybe Robert Sedgewick). For scientific computing, most *active researchers* would suggest a book like Michael Heath's. For random numbers, you'd be better off with Kelton and Law's book on simulation. For computer architecture, everyone uses Patterson and Hennessey. See a pattern here?

The truth is that fields mature, and textbooks get better and better. Knuth has decided that it's too much work to stay current; he'd rather stick to 6-bit MIX assembler code and his precious universal truths.

Well, Professor Knuth, I have news for you: there are more recent books out there that do a much better job at stating "universal truths" with the added benefit of being easily readable.

I don't buy the excuse that it's too much work to re-write code examples in different languages. Isn't this what graduate students were made for Prof. Knuth? Hell, you don't even have to pay them that much. Just try not to speak down to them, oh great one.

I also don't buy the excuse that he uses MIX so that the reader can look at the finer details of performance and memory consumption. Isn't this the same man who said that "premature optimization is the root of all evil?" In other words, don't optimize; use a better algorithm. You don't need to look at assembly code to analyze algorithms, O(n) analysis should suffice...at least, it's more of a "universal truth" approach.

By trying to write a complete survey of computer science, Knuth trys to be everything to everyone. In doing so, he does nothing as well as he could have (and certainly not as well as the textbooks currently being used). What he has ended up with is an expensive white elephant, that will look pretty while it collects dust.
Stop making excuses Professor Knuth. Get off your...organ and get back to work. 
展开阅读全文
打赏
0
0 收藏
分享
加载中
SamXIAO博主
https://tech.ifeng.com/c/7se7ancK3eh
王垠 V.S. 赵海平,这场面试之战到底谁赢了?

2019年12月23日 21:00:03
来源:雷锋网
0人参与0评论

近日,两位程序员之间的纠纷上了热搜;不过,这两位并不是普通的程序员。码农界网红王垠此前写了一篇文章,吐槽阿里某 P10 员工在面试时对自己的不尊重;随后,这一员工后被证实为阿里巴巴技术保障部研究员赵海平。
01/05 10:28
回复
举报
更多评论
打赏
1 评论
0 收藏
0
分享
返回顶部
顶部