21 ms·
Ask HN: Is Knuth's TAOCP worth the time and effort?
I'm starting the first volume.
Right at the start, Knuth introduces Induction Mathematical Proof, and more specifically tries to show that we can describe it as an `algorithm mathematical proof`.
I showed it to a friend who is quite good at math, and he told me the book may be trying too hard especially in the examples variety, and how it might not be needed for comprehension's sake.
Would you still recommend this book, and if yes, in what circumstances?
- commandersaki 3y agoI find reading the historic academic papers and technical reports on a specific subject that is covered by TAOCP more rewarding. I see TAOCP as a survey of the different fields and read the original sources for more depth.
- mikewarot 3y agoIf you're a mapper[1] like me, it sure is. I ignored the math I couldn't grok, and got all those lovely well described computer fundamentals to grind against the things I already knew, and discover new connections. [1] https://wiki.c2.com/?MappersVsPackers https://wiki.c2.com/?MappersVsPackers
- adastra22 3y agoYour milage will vary. I got zero value from the books. They do make a good doorstop though.
- collyw 3y agoThanks for being honest about it. Sad to see that it's downvoted. I guess people spent the time and effort and don't want to admit it might not have been valuable.
- Dudester230602 3y agoMaybe people are still in a denial that all companies want is some LeetCode and funny scripting languages.
- anonzzzies 3y agoThat's the only answer; SICP and TAOCP are totally useless in an average modern setting. People just copilot glue drivel all day long. You have to be interested in fundamentals and basically write low level stuff (OS/DB/PLD) to really benefit from these things and most, by a large margin, will never touch that stuff. Edit: for instance, there is now a SIMD article on HN #1; how many people actually are really interested in that? Those should overlap the people who would enjoy these books.
- sgift 3y agoOr maybe people don't care just about that but instead have a higher ambition in furthering their craft. Be it for joy, some sentiment of "getting better" or whatever. Yeah, sure, most of my days I'm a glorified data converter. I take data in whatever shoddy system and format the customer has it and bang on it long enough so that it fits into our own systems and can be used there. Does TAOCP help me with that? Well, maybe, mostly no though. I still treasure the parts I've read (I freely admit not having read all of it, but some parts and done some of the exercises) even if from some strict capitalist time = money point of view they probably wouldn't have been worth it.
- GuB-42 3y agoI think LeetCode is one of the activities where it is worth reading TAOCP, more than for most coders actual jobs.
- defrost 3y agoThe comment above clearly and honestly stated that "your mileage may vary". Generally people that continue reading through TAOCP and invest the time and effort in doing so do get value from that or are foolish to keep going. I read the early volumes thoroughly in the 80s and 90s and got a lot of insight into, for one example, methods for constraining error when doing chained numerical calculations. His approach alone was inspiring at the time even if specific chapters weren't of any immediate interest. They're not especially useful for general journeyman programmers and they're but one star in the firmament for people aiming higher .. but they are worth the effort if the material is of interest.
- adastra22 3y agoBut you’d get all that info, and more, from a numerical analysis textbook. When I read TAOCP it was right after university at the culmination of an 8 year process where I had self-studied a literal heap of graduate level texts and papers. I had been wrongly advised that TAOCP would be better saved as a capstone, where I could understand better its depths. It had no depth, and literally everything in it was better and more thoroughly explained by other works I had already engaged with. Oh, I did learn one very valuable thing: not to blindly trust the advice of others. I wish I had learned that earlier, in which case I could have thrown it on the DNF pile and gotten that month of my life back.
- varjag 3y agoThere's hardly a chance that one would both (a) read through all of TAoCP and (b) not extract any value from that. The attention required to wade through the books can't be sustained if you have no interest.
- adastra22 3y agoWell, I did read through it all and got zero value.
- starcraft2wol 3y agoSo what do you do with your combinatorics, math, and logic skills that you got from reading?
- adastra22 3y agoI’m not sure what you’re asking? I do a fair amount of algorithm development in my work. I’ve implemented C++ containers before. I just learned what I needed for that from sources other than Knuth, and those sources did a better and more thorough job explaining it.
- txs 3y agoHow do you measure the value? I treasure these books, they've brought me so much joy over the years. They've likely not affected my career trajectory much, but they've absolutely enriched my personal life.
- matwood 3y agoExactly. It’s hard define value. Did some random thing you read lead to some other insight? Can you link them directly? I think societies relentless pursuit of productivity and ROI has killed the creativity that comes from general knowledge.
- adastra22 3y agoThere wasn’t anything useful in these books I didn’t already know from an extensive binge into CS theory and practice. There was no new insights either. There was a lot of useless knowledge that wasted time to cover, like how to optimize for his totally made up machine language.
- stonogo 3y agoAll machine languages are totally made up.
- adastra22 3y agoSure, but the span of machine languages that are in actual use occupy a small cluster of possible design space. MIX, the language invented by Knuth, is not within this cluster. Maybe computer architectures in the 1960's looked like this, idk. I wouldn't know: I'm not that old. But it's also a weirdly esoteric, crusty machine language. If it was a Turing tape machine, or an idealized stack machine, that I'd understand. Those are invented architectures that are amenable to analysis and in which the analysis (e.g. maximum stack size, maximum tape use) reflects fundamental properties of the algorithm. But MIX is just this weird thing that neither resembles CPUs you are likely to use, nor is it particularly useful for analysis.
- 3y ago
- secondcoming 3y agoSame. I bought physical copies years ago but ended up giving them away. The main problem is that algorithm examples are specified in a fake machine code. It’s not that useful when things can just be Googled now.
- Koshkin 3y agoWell, the Turing machine is also “fake.” It is used for some analytical research. Similarly, Knuth uses his MIX for the analysis of algorithms.
- adastra22 3y agoIt is poorly adapted to that use case though. Either use an abstract machine that captures the essence of the algorithm better, or use a more realistic yet still simple machine (e.g. MIPS or RISC-V). MIX is a middle ground that fails on both fronts.
- xxs 3y agobook 3, especially sorting and hashing is pretty much contemporary. The linear probe, alone, and deletion shift of 6.4 is more than worth it.
- adastra22 3y agoBy contemporary you mean relevant? That’s not my complaint. TAOCP is pedagogically bad and the content is better learned from other sources. People just seem to elevate Knuth to divine status and treat his books like the Bible. Why, idk.
- adrianN 3y agoWhat are your goals? Knuth's books are a very rigorous tour through computer science. You will almost never need this amount of rigor as a software engineer, or indeed, as a computer scientist.
- usrnm 3y agoIf you want to pursue an academic career in computer science, then yes, probably, I don't know. If you just want to "grok" algorithms to prepare for an interview, then there are much more time efficient ways to do it.
- bawolff 3y agoThis is a book that is literally famous for being one of the most rigourus and comprehensive computer science books ever written. I feel like if you don't already know what you're getting into then it probably isn't what you are looking for.
- wodenokoto 3y agoI thought the books where a kind of reference material, rather than a guided study.
- Jtsummers 3y agoIt's both. The texts are comprehensive and go into great detail on the covered material. There are also a large number of exercises throughout. It's suitable as both a reference text and a study text.
- svat 3y agoIt's a guided study, but because doing the guided study is daunting and would take years, in practice many people (among those who read it at all) tend to use it as a reference, dipping in to specific topics here and there.
- DonHopkins 3y agoIf you're looking for a shortcut, read Peter Norvig's "Teach Yourself Programming in Ten Years". https://norvig.com/21-days.html https://norvig.com/21-days.html
- coolThingsFirst 3y ago[flagged]
- DonHopkins 3y agoNot to continue learning to program for at least 10 years?
- dang 3y agoPlease don't post shallow dismissals. If another comment is wrong, it's great to explain why (as long as you do it without swipes etc. - see https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html). But if you don't explain why, the comment doesn't contain any information that people can learn from, and is just a putdown. We're trying to avoid that here.
- linguae 3y agoOne suggestion: if the mathematical preliminary section in Volume 1 of TAOCP is too difficult, you might benefit from the textbook Concrete Mathematics by Graham, Knuth, and Patashnik. Concrete Mathematics is essentially a gentler (but still rigorous) introduction to the mathematical concepts covered in the first volume of TAOCP.
- HelloNurse 3y agoI confirm it has a similar general style, very high quality, rigorous and readable, but in the format of a textbook rather than an encyclopedia.
- sn9 3y agoAnd it also includes full solutions in the back so it's great for self-study if you have the prereqs (probably calculus and maybe an earlier exposure to discrete math).
- jll29 3y agoI recommend you read through volumes 1 and 3 cursorily, skipping things you can't immediately understand. I read through volume 1 several times. I then skimmed through the arithmetics part of volume 2 and read only the section about random numbers, which is very fascinating but you will be able to live without unless you are doing simulations or cryptography/cryptoanalysis. Whether you will need volumes 4a, b, c depends on whether your work has much to do with combinatorics. I'm a professor and I did not need most of it, but had a good laugh about the hidden gems and jokes like the exercise about Knuths personal pipe organ. As a software engineer, you may occasionally consult volumes 3 and 1 (searching, sorting, data structures). [Side node: If I was Knuth, I don't think I would have created three subvolumes instead of the planned single volume 4. While it is true that the material exploded, that will always be the case, and is also true for the other chapters. In his shoes, I would have worked on succession planning and trying to map out the remaining volumes so that the book can be completed one day. Under Knuths approach (esp. going back to update the existing volumes repeatedly on the way) TAOCP will unlikely ever be completed, which would be a shame.]
- teo_zero 3y agoAre you suggesting that Knuth's approach is "depth first"?
- vjerancrnjak 3y agoIt's interesting how far he takes particular topics. One on binary decision diagrams ended up with novel algorithms related to zero-suppressed binary decision diagrams. I think he even "broke" counting records for various hard counting problems (and submitted the numbers at OEIS). It does feel that sometimes he goes deeper than what you'd expect from a 7 volume book. As with any complicated topic, you need to give yourself some sleep to be able to truly intuit it.
- michaelrpeskin 3y agoYeah, this is how I read TAOCP. I was a grad student working on computational chemistry, so I had lots of downtime waiting for code to compile or long calculations to run (and I didn't have the fancy cloud to run tons of stuff in parallel). I got TAOCP out of the library and just read through it from beginning to end. I didn't work any problems and I skipped the "hard" stuff like proofs (side note: that's how I read all math, I read what they're proving, but don't follow along with the proof, I just tuck it away in my head what was proved and then if I come across a problem where I need it then I go back and try to understand it). One day I was working on a problem and I realized that I was storing a lot of 0's in my matrix and I remembered that I read about sparse matrices in TAOCP (this was before you could just go to numpy and make a sparse matrix). So I went back to that chapter and used that to solve my problem. That's happened to me many times in my career now, I remember that I read the general idea in TAOCP and then when I realize I need it, I go back and learn it for real. If you want to be someone who understands computation (using computers to solve real problem), then it's probably good to have "read" TAOCP just to see what kinds of problems other people have encountered and know that there is at least one good solution to them. Then if you ever need to solve that problem, you know where to look for a start. A little more philosophical: a culture needs a common core set of ideas that everyone can reference. When working together as a group, having a set of common ideas is a great shortcut in communicating. I'm not religious, but I see the bible as a historical way that this worked for the western cultures - there was a set of "givens" that everyone could hang their ideas off of. Every field of knowledge needs this common understanding. I view TAOCP as this for the field of computing. There are better ways to solve many of the problems now, or common libraries that provide the solutions, but having the problems named and discussed gives everyone a good starting place to talk. tl;dr - yes, TAOCP is good, read it to learn the concepts and ideas that people smarter than you solved years ago.
- deleted 3y ago[deleted]
- oytis 3y agoAs a pastime, maybe. For a practitioner CLRS offers better value for time spent IMO, and is not devoid of mathematical rigor either.
- bmacho 3y agoCormen, Leiserson, Rivest, Stein : Introduction to Algorithms https://en.wikipedia.org/wiki/Introduction_to_Algorithms https://en.wikipedia.org/wiki/Introduction_to_Algorithms
- rzzzwilson 3y agoIf you are at all interested in computer science, read volume 1. If you want to go further after that look at the other volumes. > he told me the book may be trying too hard Knuth isn't trying to write a novel or something to learn from, rather a concise, comprehensive attempt to cover the field of Computer Science. It's a repository of knowledge. He marks some exercises at 50 which, from memory, means that if you can solve it fully you are in the running for a Turing award. One of the Python core developers was once asked what the developers did in their sparetime: We read Knuth so you don't have to [0]. [0] https://www.norvig.com/quotations.html https://www.norvig.com/quotations.html
- varjag 3y agoCheck one out from a library and see how you feel after a few chapters.
- bombcar 3y agoThis is the easiest answer. Check out the first (or second, or third) volume and skim-read it. You'll either be interested, or return it and not feel a desire to get it again. And maybe years later you'll want to dive in.
- gjvc 3y ago"Computer Science is no more about computers than astronomy is about telescopes." -- Edsger Dijkstra
- bryanrasmussen 3y agoI've read SICP - loved it until it got into the later object orientation parts - so I'm wondering in if you LOVED X IS Y FOR YOU sort of comparison - What books if you liked will you like TAOCP If you hated skip TAOCP. Me: Loved SICP totally wore out Godel, Escher, Bach Somewhat angry at A New Kind of Science
- anthk 3y agoAre you me? After SICP and GEB, get "The computational beauty of nature".
- dragonelite 3y agoDoes a christian needs to read the bible to a be christian not really. Same with TAOCP and programmers, but the more you read about CS the more complete of a programmer you become. For example i never thought i would use the basic compiler knowledge i gained during my bachelor. But at one of my first consulting gigs it did helped knowing about abstract syntax tree, where you can add and remove nodes. This knowledge helped me create a highly automated refactoring tool for an old but massive enterprise code base. This was the only situation in my whole career for now where i needed this knowledge, the rest has all been about creating webpages and rest apis :p
- DonHopkins 3y ago[flagged]
- aestetix 3y agoYou do know that Knuth is a devout Lutheran, right?
- defrost 3y agoThe perfect segue to another classic: Knuths Organ Works https://www.youtube.com/watch?v=OBO613Q8hAw https://www.youtube.com/watch?v=OBO613Q8hAw
- DonHopkins 3y agoAnd that certainly doesn't mean the bible doesn't subjugate women and condone slavery and child murder (which you can easily verify by reading it yourself), it simply means he's steered clear of addressing those points (which is a pity). His primary interest lies in the patterns, structures, and the mathematical beauty of the scriptures, rather than in theological or moral interpretations, which are still there and deeply influence and corrupt society, despite his ignoring them. And that shows that expertise and rigor in one field doesn't necessarily translate into expertise and rigor in another field.
- 3y ago
- ACS_Solver 3y agoI worked through parts of TAOCP when I was a graduate student (and by parts I mean a very small, tiny fraction of the book). It was highly useful to demonstrate rigorous techniques of how we can analyze algorithms, and I used it a couple times as a reference material. I would only recommend the book to people who want a career in academic CS or are looking for an exhaustive theoretical understanding of the topics covered. A "proper" read of one TAOCP volume would probably take in excess of a year for a well-prepared reader. TAOCP is extremely rigorous and detailed, the discussion of any topic there will cover every detail. For practical software engineering, it's not useful, you don't deal need that level of theoretical understanding as a software engineer (if you're one of the few who need it, you'd know you are). And you need a very solid mathematical background to actually understand it. If you want to understand the theory of CS algorithms, I think the CLRS "Introduction to Algorithms" is an excellent textbook. It covers about everything most people are likely to encounter, has comprehensive mathematical analysis but is much easier to follow than TAOCP. For an understanding of the mathematics involved, Concrete Mathematics is a good book, it teaches the mathematical concepts and tools that are the foundation of other, more rigorous books.
- teleforce 3y agoApparently there is another more accessible several volumes algorithm books from another Stanford University professor, Algorithm Illuminated series by Tim Roughgarden: https://theory.stanford.edu/~tim/won1samplefinal.pdf https://theory.stanford.edu/~tim/won1samplefinal.pdf
- svat 3y agoA little bit of history about the book series may help understand what is in it. In 1956, Knuth graduated high school and entered college, where he encountered a computer for the first time (the IBM 650, to which the series of books is dedicated). He took to programming like a fish to water, and by the time he finished college in 1960, he was a legendary programmer, single-handedly writing several compilers on par with or better than professionals (and making good money too). In 1962 when he was a graduate student (and also, on the side, a consultant to Burroughs Corporation), the publisher Addison Wesley approached him with a proposal to write a book about writing compilers (given his reputation), as these techniques were not well-known. He thought about it and decided that the scope ought to be broader: programming techniques were themselves not well-known, so he would write about everything: “the art of computer programming”. This was a time when programming a computer meant writing in that computer's machine code (or in an assembly language for that machine) — and some of those computers were little more than simple calculators with branches and load/store instructions. The techniques he would have to explain were things like functions/subroutines (a reusable block of assembly code, with some calling conventions), data structures like lists and tries, how to do arithmetic (multiplying integers and floating-point numbers and polynomials), etc. He wrote up a 12-chapter outline (culminating in "compiler techniques" in the final chapter), and wrote a draft against it. When it was realized the draft was too long, the plan became to publish it in 7 volumes. He had started the work with the idea that he would just be a “journalist” documenting the tricks and techniques of other programmers without any special angle of his own, but unavoidably he came up with his own angle (the analysis of algorithms) — he suggested to the publishers to rename the book to “the analysis of algorithms”, but they said it wouldn't sell so ACP (now abbreviated TAOCP) it remained. He polished up and published the first three volumes in 1968, 1969, and 1973, and his work was so exhaustive and thorough that he basically created the (sub)field. For example, he won a Turing Award in 1974 (for writing a textbook, in his free time, separate from his research job!). He has been continually polishing these books (e.g. Vols 1 and 2 are in their third edition that came out in 1997, and already nearly the 50th different printing of each), offering rewards for errors and suggestions, and Volume 4A came out in 2011 and Volume 4B in 2023 (late 2022 actually). Now: what is in these books? You can look at the chapter outlines here: https://en.wikipedia.org/w/index.php?title=The_Art_of_Computer_Programming&oldid=1176536519#Chapter_outlines https://en.wikipedia.org/w/index.php?title=The_Art_of_Comput... — the topics are low-level (he is interested in practical algorithms that one could conceivably want to write in machine code and actually run, to get answers) but covered in amazing detail. For example, you may think that there's nothing more to say about the idea of “sequential search” than “look through an array till you find the element”, but he has 10 pages of careful study of it, followed by 6 pages of exercises and solutions in small print. Then follow even more pages devoted to binary search. And so on. (The new volumes on combinatorial algorithms are also like that: I thought I'd written lots of backtracking programs for programming contests and whatnot, and “knew” backtracking, but Knuth exhausted everything I knew in under a page, and followed it with dozens and dozens of pages.) If you are a certain sort of person, you will enjoy this a lot. Every page is full of lots of clever and deep ideas: Knuth has basically taken the entire published literature in computer science on each topic he covers, digested it thoroughly, passed it through his personal interestingness filter, added some of his own ideas, and published it in carefully written pages of charming, playful, prose. It does require some mathematical maturity (say at the level of decent college student, or strong high school student) to read the mathematical sections, or you can skim through them and just get the ideas. But you won't learn about, say, writing a React frontend, or a CRUD app, or how to work with Git, or API design for software-engineering in large teams, or any number of things relevant to computer programmers today. Some ways you could answer for yourself whether it's worth the time and effort: • Would you read it even if it wasn't called “The Art of Computer Programming”, but was called “The Analysis of Algorithms” or “Don Knuth's big book of super-deep study of some ideas in computer programming”? • Take a look at some of the recent “pre-fascicles” online, and see if you enjoy them. (E.g. https://cs.stanford.edu/~knuth/fasc5b.ps.gz https://cs.stanford.edu/~knuth/fasc5b.ps.gz is the one about backtracking, and an early draft of part of Volume 4B. https://cs.stanford.edu/~knuth/fasc1a.ps.gz https://cs.stanford.edu/~knuth/fasc1a.ps.gz is “Bitwise tricks and techniques” — think “Hacker's Delight” — published as part of Volume 4A. Etc.) • See what other people got out of the books, e.g. these posts: https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art055 https://commandlinefanatic.com/cgi-bin/showarticle.cgi?artic... https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art063 https://commandlinefanatic.com/cgi-bin/showarticle.cgi?artic... https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art070 https://commandlinefanatic.com/cgi-bin/showarticle.cgi?artic... are by someone who read the first three volumes in 3 years. For a while I attended a reading group (some recordings at https://www.youtube.com/channel/UCHOHy9Rjl3MlEfZ2HI0AD3g https://www.youtube.com/channel/UCHOHy9Rjl3MlEfZ2HI0AD3g but I doubt they'll be useful to anyone who didn't attend), and we read about 0.5–2 pages an hour on average IIRC. And so on. I find reading these books (even if dipping into only a few pages here and there) a more rewarding use of time than social media or HN, for instance, and wish I could make more time for them. But everyone's tastes will differ.
- yomritoyj 3y agoThey are great books about some combinatorial mathematics inspired by programming problems. Not the best investment of time if you want to learn programming itself, because: 1. Most of the time you are not implementing foundational algorithms like sorting or SAT solving. You use mature implementation in libraries. 2. If you are in fact implementing foundational algorithms, then the existing volumes of Knuth cover only a very limited set of problem areas. 3. If you are implementing something in an area covered by Knuth, the books are worth looking into as a reference, but often writing performant and robust code requires considerations not in Knuth. This is because Knuth works with an idealised machine ignoring things like parallelism, memory hierarchy etc. and understandably does not get into software design issues.
- jimbomins 3y agoI'm not sure your point "3." is wholly correct. They do also go much wider than just combinatorial math.
- cracrecry 3y agoIf you have to ask yourself this question. No, It is not. I read TAOCP out of curiosity long time ago. Has it been useful for me? Very much. But the usefulness came from abstract connections that clicked later in my life almost randomly. I am not a common individual. If you expect a direct practical application of what you read, I believe you better choose other material that suits your needs better.
- max_k 3y agoThis is certainly a matter of taste. I saw many prominent people everywhere praising TAOCP, but I was disappointed when I finally read the first three books some 10+ years ago. So much disappointed that I regret taking all the time to read it - not because they're bad books, but because I think that time would have been better spent learning things a different way. What bothered me most is MIX. I think using a very low-level language to teach algorithms is a pretty bad choice. Algorithms are high-level concepts, and using an assembly-like language just distracts from those concepts; it requires you to solve so many micro-problems orthogonal to the real problem, and forces you to repeat yourself over and over. I prefer to implement abstract ideas in abstract code. Using MIX just causes suffering for no point. I learned a lot about math from TAOCP (but I've never needed it for anything).
- mariusor 3y agoDid nobody create a MIX virtual machine or compiler in all this time?
- Jtsummers 3y agoYes, and also for MMIX, the successor version.
- svat 3y agoWhen the books were written, the target audience would all be writing programs in (very different) machine languages, so the “mix” he created of existing computer architectures was a good one (https://retrocomputing.stackexchange.com/a/18176 https://retrocomputing.stackexchange.com/a/18176). The specific MIX language is no longer similar to present-day machines (self-modifying code is out of style, for instance), which is why he came up with "MMIX" and there's a book (“The MMIX supplement” by Martin Ruckert, but carefully proofread by Knuth) with the MMIX equivalents of all the MIX programs. But in any case the algorithms are taught in English not MIX; the MIX programs are only a very tiny part of the books (https://news.ycombinator.com/item?id=14520230 https://news.ycombinator.com/item?id=14520230 — the 3000+ pages of Vols 1–4A have only 90 assembly programs), used only when the low-level details are actually relevant. So they can be skipped if one is not interested in them.
- nickcw 3y agoI've read most of Volumes 1-3 of TAOCP. I think you can read at various levels though. When I say I've read most of Volumes 1-3, I mean literally that, I read the text through. At that level it isn't too difficult to read, and you'll learn a lot like that. However some bits I've studied in much greater detail, like for instance the multi-precision arithmetic algorithms which I had to implement. For that I read it multiple times, implemented the algorithms, did some of the exercises. That takes much much longer than just reading it through. It is rather like reading a research paper which you do roughly like this, stopping after any step where you think it is no longer providing value to you. 1. Read the title 2. Read the abstract 3. Read the paper through quickly. 4. Read the paper through slowly being more critical, making notes. 5. Read the paper through again working through the maths, implementing the algorithms, making sure you understand everything. To get the most out of it, you'll need to go to level 5, but you can get a great deal out of it at the earlier levels. So I've read most of TAOCP at level 3, half a volume at level 4 and only 50 pages at level 5. If nothing else I've loaded the index in my head! PS the examples are notorious in TAOCP. The easy ones will take a few minutes and the hard ones are unsolved research problems!
- djtango 3y agothe hard ones are unsolved research problems? I haven't read the book, so he poses research questions as exercises to the reader...?
- Jtsummers 3y agoYes. He has a system for assigning difficulty ratings to exercises. I don't have the books at hand, but the highest level were open research problems, potentially suitable for PhD work and the like.
- m463 3y ago> He has a system for assigning difficulty ratings He's like a depth-first system guy... I suspect he only planned the 7 volumes because it was a requirement to start out wide.
- PennRobotics 3y agoTAOCP is about like reading an encyclopedia; a very well-written, black and white encyclopedia with not-necessarily-clear illustrations. For instance, I just opened randomly to the binary tree traversal material in Vol. I. It's very mathematic or formal, e.g. "T2. [P = Λ?] If P = Λ, go to step T4." and so on. To fish out some of the more interesting details, you have to look through the questions and then flip to the answers. Meanwhile, https://en.wikipedia.org/wiki/Tree_traversal https://en.wikipedia.org/wiki/Tree_traversal has the same information but somehow more clearly presented. If I flip to other random pages and scan for 30 seconds, I can't find much that is actually interesting---particularly in the early volumes. ----- The Art of Electronics is more my speed, as it's a collection of real-world applications, deep dives into each component type, quick comparison tables, and clear overview of a specific design's pros and cons. It's as much interesting to read through as it is useful as a reference. I can flip to basically any random page of The Art of Electronics and find something eliciting, "Oh cool." I can't say the same for TAOCP.
- _zoltan_ 3y agohad he wrote it in 2 years in 1968, it would be long forgotten by now.
- wiz21c 3y agoif you use "sort" in your daily life, you don't need TAOCP. A good tutorial will do. If the "sort" provided by the libs you use doesn't work for you and you feel you need to taylor it to your needs, then start by TAOCP (an dbe sure to have time to do so, it's not an easy read when it comes to details).
- al_be_back 3y ago>> I'm starting the first volume you've told us about your friend (hello there friend), but not said anything about your background / the context in which you're "starting". So... It's generally aimed for those studying Computer Science and/or have deep interest in Theory of programming + computation. Knuth loves algorithms, he even has algorithm on how to Read the book and approach the exercises (difficulty, mathematical complexity etc).
- barrkel 3y agoIt's not usually useful, per se, unless you are able to refer to it during programming competitions, or if you're implementing a runtime library and want to brush up on the tradeoffs of some low level algorithms - but even then, the state of the art for e.g. sorting is outside the books. I think the reader is improved for having read it, because it can open one's eyes to the fractal detail of solutions to coding problems.
- h2odragon 3y agoTotally worthwhile. If you don't want to sit down and read them linearly, that's understandable. Keep them in the bathroom and open them at random at idle moments. Like the Bible or a "Complete Shakespeare" there's something worth your time on almost any page you pick.
- ptero 3y agoThere is no universal answer. Try it. Read a few random sections from the first three books. If you cannot put it down, this series is for you. Otherwise, I would skip it. Personally, I think the TeX (that Knuth designed because he could not typeset the TAOCP to his liking) is a much more valuable side effect of Knuth writing the TAOCP than the books themselves, but this is not a popular opinion, at least within my Stanford-educated friends.
- Uptrenda 3y agoI don't think most of us here are the intended audience for a book like this. TAOCP is meant to be a comprehensive compilation of the field of computer science. Such content is useful for people like researchers, lecturers, and those who work on computer languages. But for software engineers - there are much better books that will help you. Some of my favorites: - pragmatic programmer - code complete - hackers and painters That's not to say his works are 'bad' -- but they are very specialized.
- bregma 3y agoTAoCP is a delightfully written comprehensive encyclopedia of computer science for those interested in learning how and why stuff works; it is fundamental theory at its best. Without having read it I would have spent my life without even knowing something like a biased base 3 numeric representation even existed (each digit of a number is represented by 1, 0, or -1 using a radix of 3 -- wonderful!). I have yet to find a practical application for much of what I've read, but maybe that's why it's got "art" right there in the title. If you're looking for some browser scripting code to cut and paste, you can go to Stack Overflow or Chat GPT to have your thinking done for you. If you want to understand what you're doing, pull out your dog-eared well-worn copy of TAoCP and spend some warm quality time with D. E. Knuth.
- deleted 3y ago[deleted]
- denton-scratch 3y agoMany other commenters apparently take the view that TAOCP isn't much help to a modern, professional programmer. That's probably true, in the sense that it deals largely with the kind of functionality modern programmer should be calling from a library, not implementing by hand. But I think it's hugely enriching to read these books. I read 1-3 back in the 70s, and was particularly inspired by Sorting and Searching, and especially the chapter on random numbers. RNGs have intrigued me ever since. I find Knuth's writing style very pleasant. He's funny. So is it worth the time and effort? Not if "worth it" means "makes you a better Javascript programmer". But it's worth it in the sense that reading books about the history and geography of a country is "worth it" before visiting; your appreciation of the place is deepened, possibly transformatively. It could even be that you would never have visited had you not read those books. I found TAOCP easy to read, much more so than most textbooks. I don't think I tackled many of the exercises; certainly none of the challenging ones. So for me, the "effort" aspect of "is it worth the time and effort" was quite low, so the ROI was quite high. If you find the books hard to read, then don't bother (and perhaps you aren't really interested in low-level algorithms).
- gorkempacaci 3y ago> book may be trying too hard especially in the examples variety, and how it might not be needed for comprehension's sake Had a giggle. Sounds exactly like something a mathematician would say.
- srvmshr 3y agoMy advisor used to say: "One of the CS bestsellers which is seldom read. That puts it right next to Bible" From the practical element, mostly No. People won't use this as a first book - or the second or third. But if you wanted a reference on something deeper, which missed any of the standard textbooks, this is the book for you. As an illustrative layman example, lets say you are modeling server usage with a mathematical model, most textbooks will tell you "hey, the pings and handshakes closely follow Poisson distribution". You pick from there and build on that information or mental model. But why Poisson model happens to be that way, why not something else - and how closely the server model cross-correlates will be realm of where TAOCP starts building the problem. It goes a layer or two deeper of yak shaving IMHO
- hiAndrewQuinn 3y agoOccasionally when I'm doing weird algorithmic stuff I end up with my nose in one of these books, combinatorial algorithms more often than many others. I'm a big fan, but I think you already have to be pretty deep into the world of algorithms and discrete math to get a lot out of them. I cheated my way into that world by starting my math minor a few years ago with Combinatorics, specifically because I felt like learning how to count things in weird ways would help my autrocious mental math (it did!).
- scrlk 3y agoD. Richard Hipp used TACOP to implement a B-tree for SQLite: > "Nobody ever taught me about a B-tree. I had heard of it. When I went to write my own B-tree, on the bookshelf behind me, I’ve got Don Knuth’s The Art of Computer Programming, so I just pulled that down, I flipped to the chapter on searching and looked up B-trees and he described the algorithm. That’s what I did. Funny thing, Don gives us details on the algorithm for searching a B-tree and for inserting into a B-tree. He does not provide an algorithm for deleting from the B-tree. That’s an exercise at the end of the chapter, so before I wrote my own B-tree I had to solve the exercise at the end. Thanks, Don. I really appreciate it." https://corecursive.com/066-sqlite-with-richard-hipp/#b-trees-and-the-art-of-computer-programming https://corecursive.com/066-sqlite-with-richard-hipp/#b-tree...
- hiAndrewQuinn 3y agoTwo of my favorite names in computer programming, working across time. Love to see it.
- zlg_codes 3y agoThis is the first article or interview I've enjoyed reading in months. Thanks for sharing!
- iso8859-1 3y agoThe interviewer is on HN: https://news.ycombinator.com/user?id=adamgordonbell https://news.ycombinator.com/user?id=adamgordonbell My favorite episode is https://corecursive.com/remote-developer/ https://corecursive.com/remote-developer/
- tenahu 3y agoTop notch podcast, one of my favorites.
- voidhorse 3y agoI haven't actually read TAOCP (yet!) so take this with all the salt you have on hand, but most fields are divisible into primary and secondary works. The ones you should read depend on how interested you are in the field and whether you want practical knowledge or deep conceptual knowledge. Take mathematics as an example. It has a rich history of primary sources written by famed mathematicians. Most people never even glance at these sources and gain a practical understanding of mathematics strictly through secondary sources like textbooks. This is perfectly fine for most people that only need to use math mechanically and don't care too much about a deep theoretical understanding. If you want the latter however, imo reading primary sources and understanding the history of a field is really important. To me, TAOCP has always been more of a primary source. If you're just looking for surface level knowledge and advice that's immediately applicable, look elsewhere. If you're looking to understand some of the fundamental concepts in the field of computing and their history, it might be a good fit.
- aijoe5pack 3y agoYes.
- aijoe5pack 3y agoTAOCP for computers. Baby Rudin for math. The Feynman Lectures for physics.
- davidkellis 3y agoIt's definitely a good reference, but I'll never read them cover to cover. Not unless I'm having trouble sleeping. :-)
- noobdev9000 3y agoNo, most of this is made trivial and redundant today. Understanding your std library performance is lot more important
- fastaguy88 3y agoI recommend this book to anyone starting CS and wondering "why do I have to learn all this stuff?" "What good is data structures and algorithms?" Read from a certain perspective, TAOCP is less a book about how to do things better (the focus of many CS courses), and more about "wow, who would have imagined ...". I think CS students might find their curricula more engaging if, rather than having a set of concepts to master, there were actually interesting puzzles to solve. Thus, I suggest reading TAOCP not as a text book, but more as a novel. Take a look at the parts that interest you (how many ways of sorting 10 numbers can you think of just using paper and pencil?). CS is a lot easier to learn as a process of surprising discovery, than as a set of barriers that must be overcome.
- deleted 3y ago[deleted]
- coolThingsFirst 3y ago[dead]
- pfitzen 3y agoIt depends on the user and the usage. In some cases reading these books doesn't yield the best return for the investment of your time. Consulting the literature that Knuth refers to, rereading and working through the examples, writing your own code could give you so much more. Volume 2 is within arms reach on my desk. After reading the book and additional literature over the course of several years, the book is filled with sticker notes. Over time my usage shifted from reading TAOCP to rereading (and changing) my notes. > Would you still recommend this book, and if yes, in what circumstances? Everyone in math/cs should at least know about the existence of theses books. A rough, cursory knowledge of the content is essential, so that one can look up things if there is the need to really understand a specific topic. TOACP should be considered as one of the best and most important/influential science books of the last century.
- maxamillion 3y agoAbsolutely, this is required reading.
- 2OEH8eoCRo0 3y agoThe fact that it's not called The Art of Software Engineering is interesting. If computer programmer was a good enough title for Knuth and Thompson then it's good enough for me.
- padjo 3y agoI think software engineering encompasses a lot more than implementing algorithms. It’s a very different practice to computer science, which is probably what Knuth would call himself these days.
- svat 3y agoI like the (overlapping) definition of “software engineering” from Titus Winters (https://abseil.io/resources/swe-book https://abseil.io/resources/swe-book) and Russ Cox (https://research.swtch.com/vgo-eng https://research.swtch.com/vgo-eng) respectively, that it is “programming integrated over time” and that “Software engineering is what happens to programming when you add time and other programmers”. In that sense, TAOCP is at something like the extreme of computer programming that is not software engineering: it's about programs for specific problems (don't need to be continuously changed with time), and by a programmer who works alone, does not involve other programmers or reuse their code/libraries.
- devchix 3y agoI bought a copy after graduating, having seen the serious-looking tomes on the shelves of many TAs and serious people. I was not a very good programmer and I thought possession of this thing would confer a magic aura that would make me look smart and maybe within its pages were incantations I could learn that made me deserve the appearance. I ventured probably past the first 25 pages. This volume and books like it are not for me, I just want to know how to do things, and a deeper understanding for me comes from doing and breaking stuff many times, over time.
- commandlinefan 3y agoI read the first three volumes and at least attempted all of the exercises. I got the easy ones, made some progress on the harder ones, and at least understood the "impossible" ones. These books are written on the assumption that you're going to work all of the exercises - I don't think that if you just read them you'll get a lot out of them. I really enjoyed working through them - I keep meaning to get around to volume 4, but can't seem to find the time to do so.
- Q6T46nT668w6i3m 3y agoI regularly reference Seminumerical Algorithms and Combinatorial Algorithms.
- lincpa 3y ago[dead]
- QuadrupleA 3y agoFunny, my first ever submission to HN was this identically-worded question, with a lot of ensuing interesting discussion: https://news.ycombinator.com/item?id=10897460 https://news.ycombinator.com/item?id=10897460
- jimbomins 3y agoIs Charles Dickens worth a read. Depends on your time, purpose and taste.
- jimbomins 3y agoIs Charles Dickens worth it? It's a matter of time, taste and purpose (in reading). I've enjoyed dipping in. Sometimes found it directly useful to work. But the best of his works I read (in full) was the MMIX book that is a literate program of the interpreter. Second to that was the typography book, a total fascinating delight. In reality there's probably almost no one who reads any volume of TAOCP in full. The only way to answer your question is probably to start reading and see if you enjoy it. But expect it take some effort.
- mortallywounded 3y agoMuch of what you'll read and learn in the books won't have any immediate impact on you or your career. If there is an impact, it will be subtle. Does that mean you shouldn't read it? Maybe. Honestly, it doesn't matter if you read it or not. Do it if you want to, but do it without the expectation of getting something out of it. If you want a return on investment for your time, you're better of building something with the knowledge you already have. Put the books away and create something.
- retrac 3y agoHave you read Euclid's Elements? Did you enjoy the proofs? And the general process? The conclusions in the Elements are what any 10th grade geometry student should already know. It's not the conclusions though, but the journey. Some people still swear by Euclid, claiming the Elements helps teach a person how to think. TAOCP is in that vein. As you have identified, it is not a programming book, and it's not a computer engineering book, and it's not really a college textbook either. It is a computer science book in the old tradition, where computer science is treated as a branch of mathematics. It won't teach you to program. As another user said, you should probably be using the algorithm your language's standard library provides. Now, if you want to know why a library's author chose a particular algorithm, the trade-offs between the options, and an open-ended and in-depth exploration of such topics, then this is the book for you. The author of that optimized tree search function you're using probably read TAOCP at some point, so you don't have to.
- JohnFen 3y agoI recommend it because it gives an excellent overview of the fundamentals of the field. Well, honestly, because the series of books were formative for me so I'm a bit biased. I can't overstate the value I got from them. I still use them as reference works to this day. However, I can't say whether or not anyone else would get the same value. I didn't think of studying them as "effort", though, because they were (and are) extremely interesting to me.
- hintymad 3y agoI'd recommend it, but I wouldn't recommend reading it cover to cover. It really depends on what you need. Here is what I read selected chapters for: - For expanding my conceptual understanding of algorithms. I still remember the thrill of learning how the Joseph's problem can be modeled as base-n modulo arithmetics. Or how powerful it is to use generating functions to compute algorithm complexities. And I read the vol 4 for a pleasant study of how we can code back-tracking in an almost mechanical way. - For historical context. Knuth is amazing at tracing the roots of algorithms, and show how the solutions to a problem evolve over time. You'll get high when seeing how a seemingly impossible problem gets solved in such elegance and ingenuity over generations of attempts by great minds. Check Vol 4 for all the wonders of combinatoric algorithms, for example. - For thorough study and pure awe. For instance, one probably learns a bit about ordered binary decision diagram (OBDD) to reduce state space by thousands of times in a formal verification system. But what if you want to see all the amazing details of OBDD and therefore getting hours of dopamine high? Vol 4 is the go-to place. - For reference. At least for a student. I got stuck implementing a fibonacci heap for my project on memory management in my OS class. And Knuth's books came to rescue. I guess professionals would still refer to Knuth for their implementation from time to time.
- brudgers 3y agoWhat do you mean by “worth?”
- eutopian 3y agoIf all you want to do is write CRUD apps, the book is not for you. That being said... To quote directly fromt a quote in the book, "Now I see with eye serene, the very pulse of the machine." I finally jumped the gun and started reading it during the summer after my acquiring my bachelors. I finished the first volume during that summer. Here are some notes: The Mathematical premliminaries reads like a novel if you have some mathematical maturity, you don't dwell too much on the sections that are over your head, and you treat the exercises as optional. This is because the book can be read from a HS level all the way through the Post-Grad level. Choose your depth. The MMIX approach was eye-opening because it opened my eyes to see computers as the 'computing' machines that they are. I indirectly gained a fundamental understanding how everything starts with the CPU. I started seeing all the high-level languages (C++, Python, Rust, Java, etc...) as the abstractions that they are. It is liberating if you have ever felt the uneasiness when you are programming in a high level language when you are nagged by the question "how is the computer doing this?" Algorithms and Data Structures( a.k.a Information Structures in vol 1): It is like going to grammar school for algorithms! Have you ever asked yourself "Why are we learning all of these abstract things about algorithms and data structures?" I got my answer from the book. What I mean by this is that after studying Knuth's approach to algorithms, you gain a firm, fundamental, and concrete understanding of their necessity, their role. Afterwards ANYTHING I would encounter on Hackerank or Leetcode became digestible. You gain a "first principles" understanding of algorithms and information structures. I believe that the book stands the test of time largely because of these points. If you have programmed to the point where you've been exposed to some sorting algorithms and some data structures and you want to continue the road to becoming an expert programmer on a firm footing, it is worth the time and effort. The caveat that I would add is do not wait until you finish all the books before you enter the job market or write software out of your own interest.
- minusf 3y agonobody is gonna mention TeX? so i will. yes, i have TAOCP on the shelf and yes guilty of "one day i'll ready it". but every now and then i open them up and just flip thru that magnificent typography. Knuth has not just written up all these things, he has developed an entire typesetting system (complete with fonts) to bring technical publishing screaming and kicking into the 20th century (when other software thought kerning and hypenation were creatures from space). it's the only program deserving a version number approximating PI.