HACKER Q&A
📣 xupybd

Is "The Art of Computer Programming" worth investing in?


I am considering buying Knuth's signature computer science textbook, 'The Art of Computer Programming'. While the book is expensive and quite extensive, I'm wondering if it's worth the investment, especially as a full stack web developer. Can you provide some insights on whether this level of computer science is valuable for my career development?


  👤 adastra22 Accepted Answer ✓
Art of Computer Programming is one of those voluminous tomes you buy to put on your bookshelf and never actually read.

Why don’t you check it out from the library and decide for yourself?


👤 simon_acca
I use it as a reference, perhaps 4/5 times a year.

Usually I reach for TAOCP with a reasonably clear idea of what specific problem I’m trying to solve and what class of algorithm I’ll try to find in there. So if you find yourself in this position at times, then might he worth the investment, otherwise I’d perhaps go for something like the Cormen instead, which can actually be pleasantly read cover to cover to get a better sense of the landscape, so to speak.

Personally I wouldn’t read TAOCP from cover to cover, the uncompromising rigor makes it quite the tough read.


👤 inasio
I recently had to work on SAT problems (and SAT solvers), the relatively recent material he wrote on them (section 7.2.2.2, close to 300 pages!) has been amazing, I sometimes just open a random section and go through it, super readable and informative. I'd highly recommend it, especially if you can have direct use of it.

👤 dyingkneepad
I read pieces of it during CS University that were applicable to whatever we were studying/implementing at the time. Got it form the library. Was worth it.

A decade later I bought it because I wanted to understand something about the selection of a specific hash function for a hash table that every book was using and no one was explaining, everybody was just referencing Knuth. That function was used in my job (in fact, the hash table at work was exactly the one Knuth had proposed). While Knuth had an explanation for it, I was not happy with it. After a ton of online researching and even reading some papers from the 70's I found an understandable explanation in a blog post by a random not-famous programmer.

One day I'll read it. But my Comic Book collection and Video Game backlog has been taking the priority for a while.


👤 bell-cot
How often do you find yourself needing to deeply understand the sort of "low-level" algorithms that "The Art" is about?

How interested are you in pivoting your career toward roles which would benefit more from such understanding?

How often would having such fancy volumes on your bookshelf boost your professional cred or self-esteem?


👤 slavapestov
They’re great books, beautifully typeset, but they’re not for everyone. Meant for people who appreciate math, they go pretty hard. Personally I’ve owned the first three volumes for 20 years now and I still learn something new every time I open them. It will take me another 20 years to work through Volume 4A and 4B. While I can’t say that anything in there has been directly relevant to my work, they’re just fun to read.

👤 flashgordon
Without answering the rest "this level of investment in CS" is something always worth absorbing. You don't have to do it as a full time course. But having the passion for that learning and having those tools in your toolbox is always worthwhile IMO. You never know when the next problem you solve will have an answer in CS theory and algos etc.

Now do you need this particular set of books to get you to that goal? Like many others who have never even to touched these master pieces - Hell yeah (if you can afford it). It's like the War and Peace of cs books - may be just much less dry!


👤 danwee
Never got that kind of perspective. You read a book if you think you'll like its content. Period. Knuth's books are no different. You probably know many colleagues of yours that have never read a technical book in their lifes and still manage to be successful with their careers.

Just read the book if you like CS. Period.


👤 spyremeown
I used it as a reference for the Welford's method of calculating the mean and variance, and for other random things throughout the years. If you need a solid /reference/ for some mathematical-computerish thing, it's probably there.

👤 jamestimmins
I have my copy bc my brother bought it, didn't read it, and realized he hadn't bought me a Christmas gift.

It'll remain unopened on my shelf until December 25, 20XX, when I also realize I need a gift for a young programmer.


👤 TexanFeller
Zero applicability to your career as a full stack developer. Read it if you truly love computer science, or appreciate it like a work of art, or for the beauty in its mathematical rigor.

👤 boonsuan
a love letter to the art

you can roughly split the art of computer programming as currently written into ten major arcs, each around 300–400 pages (including the answers to exercises):

1 introduction (math prerequisites, assembly programming)

2 data structures (lists, stacks, queues, trees, memory allocation, etc.)

3 random numbers (generating random numbers, testing for randomness)

4 arithmetic (floating points, polynomial arithmetic, etc.)

5 sorting

6 searching (comparisons, hashing, etc.)

7.1 binary tricks (includes binary decision diagrams)

7.2.1 generating combinatorial structures (combinations, permutations, partitions, etc.)

7.2.2.1 the exact cover problem

7.2.2.2 satisfiability

now, in any other book, each of these parts would maybe be 50 pages or so, and the whole thing would fit in one 500 page book. but don knuth is interested in the art, and the art is in part about understanding things as clearly as possible. that means understanding at an instruction by instruction level what is happening in the machine, and finding the appropriate mathematical structures that give insight into what algorithms are really doing. don is interested in thinking and writing as clearly as possible, but without sacrificing detail and resorting to handwaving. this is a difficult balance, because the material itself is hard.

this means that when don wants to understand sorting, he devotes 50 pages to the mathematics of permutations (section 5.1), and that he creates an idealized RISC-V architecture (MMIX) with a meta-simulator that supports all sorts of pipelining, caching, virtual address translation, etc. systems, so that he can count the exact number of memory accesses made at the machine level, so as to analyze a sorting algorithm. this means that when he wants to investigate combinatorial structures like graphs, but lacks a good class of test cases, he goes off and writes a 600-page book (The Stanford GraphBase) so that he can have consistent example data for writing about graph algorithms.

another part of the art is to gain an appreciation of the tapestry of human thought as it is woven through the centuries and millennia. don does his best to trace the roots of ideas, carefully studying all sorts of manuscripts from the past, in German, Latin, French, and really anything he can get his hands on. he traces the full names in their original languages of all people mentioned in the art, with the index of volume 4A spanning 50 pages. section 7.2.1.7 explores the history of combinatorial generation through old Chinese manuscripts, Sanskrit prose, the meter of Greek poetry, and so much more, showcasing the spirit of the programmer as it goes back hundreds of years before the advent of the program.

much of the art lives in the exercises. there are more than 4000 of these exercises throughout the art; many sections ending with at least 50 of them. many of these exercises are an entire research paper, where don has digested it, as well as the papers surrounding it, and provides in the exercise a skeleton of essential ideas that gave life to the paper, leaving you to coat those bones with flesh. he reads a hundred papers or so before writing each section, working in what he calls “batch processing”, and studying in chronological order the papers that form the lineage of a topic from genesis to present day.

the art is a living work. the third edition of volume 1 has gone through 52 printings since 1997, and many more printings if we count from the first edition of 1968. since 1968, don has read through thousands upon thousands of letters from readers, with comments ranging from suggestions for new material, to petty remarks like “i think this comma here should be a semicolon instead.” he will read it all and think it through, because he wants to get it right. he then scribbles his reply in pencil to your email printed out, and you get it back by snail mail half a year later, with a reward ‘check’ if he used your suggestion. every printing incorporates many little changes all over the place, and no two printings of the art are the same. just last week he inserted a new exercise into section 1.3.3 for the 53rd printing of volume 1, to anticipate new material in 7.2.2.8 he just wrote on decoding the Enigma machine (https://www-cs-faculty.stanford.edu/~knuth/fasc9b.ps.gz), as an example of applying backtracking.

the art is the pursuit of beauty. after the galley proofs for the second edition came back in 1977 with shoddy typesetting, he spent a decade on TeX, because, well, the letters have to look right in the words, the words have to look right in the paragraphs, and the paragraphs have to look right on the page. and part of beauty is fun, without the search for applications. volume 4b is full of puzzles with little attempt to justify their utility — master the art, follow the beauty, and utility will come along naturally later.

the art is a love letter to the spirit of computation, written with the nothing less than the entire life and force of don knuth. and that’s a lot — don knuth works really, really hard, and he continues to write the art at the age of 85 today (he’s now writing 7.2.2.3).

so you ask, should you read the art? i say: if you are longing to find, to understand the beauty in these ideas, and to really come to see the very pulse of the machine. goals of utility and efficiency will not be best served here — there are many better books for such purposes — for to view through this lens the art, it would perhaps amount to mere diminishing returns. (that said, you will certainly be a better programmer if you read his book! it might just take a while.) don wants to get it perfect, as perfect as a human work can be, and has spent his life seeking this beauty. the art is his adventure logs, and thank God he should have chosen to share them with the world.


👤 jhp123
if you like a more functional POV then I would highly recommend Pearls of Functional Algorithm Design (Bird) and Purely Functional Data Structures (Okasaki)

👤 h2odragon
Its a great set of books to have in the bathroom. Crack it open anywhere and there's something interesting.

👤 MattPalmer1086
I would say not worth the investment unless you know you will be working on very computer sciencey things.

Having said that, I have the first 3 volumes in my shelf and I do look at them occasionally. But I mostly like having them just because they are so iconic. Shallow yes, but makes me happy.


👤 warrenm
I've always wanted to buy a copy .. but other books end up getting my attentio instead

👤 swah
I'd love to give away mine if anyone in Brazil wants it. Couldn't sell it... I just bought it cheap because of the beautiful edition and paper. Love that old paper they used to use.

👤 brudgers
Art of Computer Programming is cheaper than good concert tickets.

About half the price of the cheapest iPad.

Less than a cattle class round trip flight to Las Vegas.

But it will give you a lifetime of intellectual engagement, if that matters to you and there’s nothing wrong with you if doesn’t.

My recommendation is it is a great way to practice at reading things you don’t understand and learning something from the experience.

But if being ignorant and afraid of its content feels like a badge of honor, ok by me. I ain’t your mom.

Good luck.