Fog Creek Software
Discussion Board

"rt of Computer Programming" by Knuth.  Opinions?

This seems to be a huge book among a lot of programmer pros, but I don't see it in Joel's recommended reading list.  I was wondering if anyone here has read the series, and if so, what their opinion is.


Tuesday, July 09, 2002

It's okay ...
seems to have a cultist following... so reader beware.

delete pIUnknown
Tuesday, July 09, 2002

Every programmer owes it to themselves to at least look at a copy.  Few people who own copies have ever actually read them in any depth.  They're a tough read.  However, every fundamental algorithm and problem in CS is in these volumes, discussed in detail. 

The real question is: do you need to study the fundamental, classic CS problems?  These days, not really.  It's possible to have a long and fruitful career simply plugging together off the shelf bits with "business logic".  However, if you ever want to be one of the people writing the off the shelf bits, then you could do far worse than these books.

btw, there are three volumes out now, with volume 4 on the way.  Seven in total are planned.  I'm afriad Knuth isn't going to live long enough to finish the series.

James Montebello
Tuesday, July 09, 2002

IMO it's a masterpiece, but I can't imagine attempting to read it from cover to cover. If you just want some C code to paste into your program, you're probably better off with something like one of Sedgewick's books. If you want a deeper theoretical understanding, and it's true that for most practical purposes you probably don't need it, then Knuth is the man for you.

One thing that does polarise readers is Knuth's use of MIX, an assembly language for a hypothetical and obsolete machine architecture, to describe the low-level implementation of algorithms. The advantage of this is that whereas Sedgewick will tell you that an algorithm has O(nlogn) performance, Knuth will tell you that it performs as 6.37nlogn + 593.24, which is the kind of information that you need when trying to decide if your value of n is large enough to justify the effort of switching from a simple O(n^2) algorithm to a tricky O(nlogn) algorithm.

An intermediate between Knuth's approach and Sedgewick's seems to be provided in the book by Cormen, Leiserson, & Rivest, but I'm too poor to afford this - I'd be interested in views on it by anyone who's read it.

Andrew Simmons
Wednesday, July 10, 2002

The Cormen, Leiserson, & Rivest Algorithms book is excellent. It's very readable and covers a wide range of material. I recommend that you read it first, and then proceed to Knuth if you'd like a more rigorous and mathematical treatment.

However, I've never used any of those algorithms directly. The built-in APIs (in the STL or JDK) for sorting, collections, etc. have always been good enough. The performance bottlenecks in my code involve other issues, such as database access speed and number of memory allocations.

Still, it nice to have a rough idea about what's going on under the covers when using the collection classes.

Wednesday, July 10, 2002

CLR( Cormen,.. )  is a very good book for most of things.  NP completeness and stuff is not that good though.

Prakash S
Wednesday, July 10, 2002

Used the Cormen book for two algorithms classes in college. (in school you're forced to by the book, whether you can afford it or not:). I liked it much better than Knuth's books. I'm not smart enough for those (translation - none of that crap translated immediately into making me a better coder). The Corment book however was more practical. P/S an IBM programming competition team from my school used this book as a reference in their competitions. I didn't notice if they had any Knuth volumes :)

Wednesday, July 10, 2002

Knuth is a genius, but I think the practical value of TAOCP is greatly exaggerated. CLR is more readable and useful, but TAOCP does have interesting historical trivia.

Zwarm Monkey
Wednesday, July 10, 2002

I wouldn't classify it as trivia. As stated by previous posters, I find it to be an invaluable reference on algorithms. The fact that I may seldom implement those algorithms is irrelevant; I bought it because I wanted to know algorithms, and now I have a great reference for them. If you need to implement algorithms, this is *THE* book for you. Period. If you are designing high level code from components, its value quickly decreases.

Mike Swieton
Wednesday, July 10, 2002

The thing I find really interesting about TAOCP is that Knuth wrote 3 great volumes, got frustrated with his typesetting tools and seems to have spent the last two decades working on TeX instead of TAOCP volumes 4-7. 

Such typical programmer behavior, but taken to glorious extremes.

Jim Grinsfelder
Wednesday, July 10, 2002

*  Recent Topics

*  Fog Creek Home