Live data from Hacker News

Ask HN: Is Knuth's TAOCP worth the time and effort?

news.ycombinator.com

1–10 of 141 posts

Ask HN: Is Knuth's TAOCP worth the time and effort?

#1
I recently purchased a boxed set of Donald Knuth's The Art of Computer Programming on Amazon ( http://www.amazon.com/gp/product/0321751043 ) based on its stellar reputation as one of the indispensible, foundational computer science books that every programmer should read.

I excitedly started delving into it last night but after an hour or two of reading and exercises I started getting the sinking feeling that I'd just wasted $178.08. It seems quite mired in 1960's-era academic minutiae and tedious mathematical formalism that doesn't seem very relevant to a modern practicing programmer.

For all its focus on algorithmic performance I found no mention of pipeline stalls, designing for cache performance, branch prediction, multithreading, etc. which are all very fundamental aspects of good performance on modern hardware.

So for those who are practical programmers and have gone down the Knuth TAOCP rabbit hole I ask - was it worth it? Did it give you knowledge and skills applicable to your programming work or was it mostly academic / intellectual entertainment?

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#2
It is more a reference work than anything else.

> For all its focus on algorithmic performance I found no mention of pipeline stalls, designing for cache performance, branch prediction, multithreading, etc. which are all very fundamental aspects of good performance on modern hardware

Yes, but pure computer science is not worried about that (maybe about multithreading)

But yeah, for a more practical/specific work there are better options (but it's going to be specific to an area)

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#4
It's a good reference, but I could never read it straight thru. I tried and failed a few times.

There is a note from Bill Gates in the back that says if you can read it all and understand it, contact him for a job.

Edit: read the comment by @geff82 in this thread. This is perfect.

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#5
The term programming here is used with the same semantic definition as "dynamic programming" or "linear programming". Don't expect the book to touch on how to code fast algorithms, rather expect Knuth to teach you the inner workings of the algorithms regardless of their implementations.

Computer science and software development are usually thought to be the same by non computer scientists, but in reality computer science is basically applied mathematics. Expect a lot of it.

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#6

It is more a reference work than anything else. > For all its focus on algorithmic performance I found no mention of pipeline stalls, designing for cache performance, branch prediction, multithreading, etc. which are all very fundamental aspects of good performance on modern hardware Yes, but pure computer science is not worried about that (maybe about multithreading) But yeah, for a more practical/specific work ther…

Indeed, it's a reference work. I've read through the first volume cover to cover, but that's probably not the best way to use TAOCP. When you're interested in a particular algorithm or topic, go find it and read that section.

If you're interested in modern architecture details, I'd recommend Agner Fog's marvelous reference books (http://www.agner.org/optimize/).

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#7
> based on its stellar reputation as one of the indispensible, foundational computer science books that every programmer should read.

A while back, I was joking with some friends that TAoCP is to the programming world what Finnegans Wake is to English literature: you're not supposed to read it, nobody's ever actually read it. We all just say we've read it, talk about how brilliant it is, and place it prominently on our office bookshelves to silently humblebrag to anyone who drops by. Sorry you had to spend $178.08 on that lesson, mate.

Re: Ask HN: Is Knuth's TAOCP worth the time and effort?

#8

It is more a reference work than anything else. > For all its focus on algorithmic performance I found no mention of pipeline stalls, designing for cache performance, branch prediction, multithreading, etc. which are all very fundamental aspects of good performance on modern hardware Yes, but pure computer science is not worried about that (maybe about multithreading) But yeah, for a more practical/specific work ther…

> Yes, but pure computer science is not worried about that

He writes in that made up assembly language specifically to consider efficiency and implementation concerns:

"Expressing basic methods like algorithms for sorting and searching in machine language makes it possible to carry out meaningful studies of the effects of cache and RAM size and other hardware characteristics (memory speed, pipelining, multiple issue, lookaside buffers, the size of cache blocks, etc.) when comparing different schemes."

Whether he achieves that is another matter.

Post reply on HN