12 ms·
Ask HN: Is Knuth's TAOCP worth the time and effort?
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?
- Uhhrrr 11y agoSo long as you don't spill coffee on it, you can always resell it. I got a set when a coworker jumped ship with no forwarding address and left all his books. It seems useful for people implementing languages and standard libraries, less useful for people using them.
- blktiger 11y agoI wouldn't necessarily read it cover to cover. I did that with volume 1 and found it interesting, but I could have done without the assembly implementations. Assembly is highly dependent on the hardware capabilities. It feels to me like C or some other close to the metal language would have been more useful. I keep volumes 1 and 2 on my desk in case I ever need to refer to them for information about a specific topic, but I have yet to actually open them.
- raverbashing 11y agoIt 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)
- rinon 11y agoIndeed, 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/ http://www.agner.org/optimize/).
- RogerL 11y ago> 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.
- geff82 11y agoTAOCP is not to learn programming or to cover everything modern. It is for the intellectual exercise, for widening the mind. And that is where its beauty lies.
- jason_slack 11y agoIt'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.
- tonocm 11y agoThe 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.
- kazinator 11y agoUmm, no. "Programming" in "TAOCP" actually refers to "making step by step recipes for a computer" to execute (and is prefixed by the word "Computer" to make this clear). In "linear programming" it refers to something completely different, namely the planning of the use of resources or optimization. "Dynamic programming" is yet something else: a narrow cluster of techniques having to do with memoization in order to help an algorithm identify overlapping subproblems and avoid re-computing them.
- tonocm 11y agoUmm, no. You got half the concept right. Programming, especially in the 70s refers to a set of instructions to be followed in order to achieve a specific task. When you prefix it with "computer" you're specifying the domain, namely all instructions that will allow a computer to do something. Like you correctly mentioned, when prefixed with "dynamic" you're specifying the set of instructions that have a common approach (to break problems into subproblems, etc etc). Similarly, when saying "linear" before "programming" you're specifying that the instructions involving this set use linear variable constrains.
- kazinator 11y ago"The term "linear programming" for certain optimization cases was due to George B. Dantzig, although much of the theory had been introduced by Leonid Kantorovich in 1939. (Programming in this context does not refer to computer programming, but from the use of program by the United States military to refer to proposed training and logistics schedules, which were the problems Dantzig studied at that time.)" Source: https://en.wikipedia.org/wiki/Mathematical_optimization#History https://en.wikipedia.org/wiki/Mathematical_optimization#Hist...
- Analemma_ 11y ago> 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.
- Someone 11y agoI read (and understood) volumes 1 to 3 (text, exercises and answers to the exercises, insofar they are present). It is not that hard to read, if you combine it with the right set of university courses in discrete math, combinatorics, and number theory, and some hacking on a 80's home computer (teaches one assembler) Especially without those math courses, I imagine it will be a tougher read, certainly for those grown up with multi-mega or multi-gigabyte machines who expect it to be on programming, not computer science. And it isn't 60's era formalism, it is low-level computer science.
- throwaway999888 11y agoIt's OK. You may display that book prominently and proudly on your cubicle's bookshelf. You've earned it! ;)
- taeric 11y agoAnd this shows a huge folly in our industry. Short answer, is the book easy? Of course not. Is it dated in approach? Yes. Sorta. What would make it better? A modern language? Why? Consider, just yesterday there was someone designing an elevator system using python. That is literally one of the first examples in TAoCP. Not long ago, there was an article about how linear search with sentinel values is actually faster than binary search for many data sets. This is, again, one of the first treatments of searches in this text. I'm waiting for someone to rediscover that you can make a tree for depth first traversal, such that you do not need to use a stack. Again, one of the early topics in these books. Curious about different characteristics of Tries/Trees/Lists/Hashes?... Is it worth the time to read end to end? Almost certainly not. The math heavy sections are definitely going to scare off a lot of people. Myself included. This mainly means to skim the exercises. But, there is a lot to offer in the industry of programming. Knuth picked an order to offer this information and is going in that order. The latest topics he is just now getting to are hugely relevant in many endeavors and I recommend people at least be aware of them.
- apalmer 11y agoNo offense, but you really should have done some research before you plunked down the cash... its exactly what you say it it is a foundation computer science book. literally.
- PaulHoule 11y agoI got a used set for $6 and I felt that was a good investment.
- brudgers 11y agoI've got a mixed edition used set. More hours of entertainment than I'll ever get to.
- Retric 11y agopipeline stalls, designing for cache performance, branch prediction, multithreading, etc. Those are issues for a subset of computer hardware. Embedded computing is still huge and has drastically different performance requirements. TAOCP is designed to stand the test of time, not focus on micro-optimizations that generally have limited performance impact and are a waste of time 99% of the time.
- dpc_pw 11y ago> Embedded computing is still huge and has drastically different performance requirements Even chips as small Cortex-M4 has a write buffer, 3-stage pipeline and branch speculation. And real embedded computing is more and more utilizing hardware similar to desktop/mobile/server. You can't run self-driving car / neural networks / image processing on a single threaded CPU with no cache or branch prediction.
- mikejmoffitt 11y agoYou can't run the car on it, but many subsystems in any car, automatic or not, can and will run on that sort of machine.
- Retric 11y agoCache is part of TAOCP As to the rest of it. It's much cheaper to use a GPU style massive array of dumb cores vs. a few faster cores. Don't forget car companies are spending billions on these chips so spending a little more on software to save a lot on hardware is a good tradeoff.
- JackFr 11y ago> TAOCP is designed to stand the test of time, not focus on micro-optimizations . . . Hmmm. My edition of "Sorting and Searching" has a section devoted to tape-sorting.
- empthought 11y agoSame strategies apply to NUMA.
- a-saleh 11y agoDisclaimer, I only read the first book. Depends what you want from it. I used the first book to study for my Bachelor's degree final state examinations, and it served me well :-) In other words, yes it is very academical, in the truest sense of the word. From what you say, that you want it to "mention of pipeline stalls, designing for cache performance, branch prediction, multithreading, etc.", you might find better use of Andrew S. Tanenbaum books. I have only read his Computer Networks [1], but it has saved me at least 14 hours of boring lectures at uni, and helped me with some protocols work. He still does research in distributed OS-es, so would hope, that rest of his books would have same amount of readability and usefulness as the one I have read :) Back to Knuth, if think you have no use in mathematical formalism, or college math in general, you will probably find it little more than intellectual entertainment. There are of course areas where having formal theory of a thing is beneficial when programming, even if you yourself don't apply it (i.e. the chapter on random numbers seems like something everybody touching any code related to security should read, i.m.o) But even then, if you suddenly need to learn more math theory, there are probably better sources than Knuth. As somebody who finished my Msc already, I like it as my intellectual entertainment just fine :) [1] http://www.mypearsonstore.com/bookstore/computer-networks-9780132126953 http://www.mypearsonstore.com/bookstore/computer-networks-97...
- xsmasher 11y agoApocryphal story: http://www.folklore.org/StoryView.py?story=Close_Encounters_of_the_Steve_Kind.txt http://www.folklore.org/StoryView.py?story=Close_Encounters_...
- kjs3 11y agoTAOCP is a fundamental work teaching fundamental techniques. If you can master it, pipeline stalls, designing for cache performance, branch prediction, multi-threading, etc., are easily understood problems and you have the tools to then attack most any other computational problems that are likely to come along. Sounds like what you want is a prescriptive tutorial addressing a set of specific computing problems. That's not what TAOCP is.
- deleted 11y ago[deleted]
- utopkara 11y agoSome people read it cover to cover, and the few I know also happen to be the best computer scientists I know of. It is hard to come by a comparable compilation of best algorithms in one place, so I occasionally have to refer to it. I wouldn't think of reading all of it, because I don't think I have the time, but it is a page turner if you are into algorithms.
- mturmon 11y agoThere would be better ways to spend your time than TAOCP. If you want to scratch that itch, a better way would be Cormen, Leiserson, Rivest, and Stein's Intro to Algorithms (https://mitpress.mit.edu/books/introduction-algorithms https://mitpress.mit.edu/books/introduction-algorithms). I'm not aware of such a universal reference for the interaction between algorithms and architecture ("...pipeline stalls, cache performance, ..."). Until that day comes...TAOCP sure looks nice on the bookshelf.
- adolgert 11y agoKnuth's books are a baseline for "how things are done" for many, many areas, so having read them lets you hit par on most holes. Optimizing code for an architecture is very interesting, but it comes after 1) figuring out which ways the math can be stated correctly and 2) calculating the order of computation. Then architecture gives numbers to put into the order of computation. Knuth focuses on the first two, but maybe a few books' worth of focusing on those is understanding them well and not such a waste.
- apetresc 11y agoIt's not useful as a reference, but it is full of delight – though only if you actually do the problems. Many of them are chains of inquiry that build on each other and culminate in some result that gives you so much intuition about whatever it was they were dealing with. If you're in the Toronto region, I actually run a reading group for these books: http://www.meetup.com/Knuth-Reading-Group-Art-of-Computer-Programming/ http://www.meetup.com/Knuth-Reading-Group-Art-of-Computer-Pr.... We get together about once a month and go through the problems together. Just last night we had a 2.5-hour session about only section 2.3.4.1. I doubt you'd be able to get this much content from a sub-sub-sub-section of CLRS.
- pmelendez 11y ago> It's not useful as a reference, I would argue the opposite... When I needed to read about the different approaches on how to shuffle a deck for a card game TAOCP was there for me. When I needed to investigate different approaches for string comparison algorithms, TAOCP was there for me. When I didn't understand what was the deal and why was so hard to implement a random number generator, TAOCP was there too. Anytime that I needed a reference for a core CS algorithm or data structure, TAOCP worked very well as a reference for me. It feels like the Britannica Encyclopedia for CS.
- microcolonel 11y agoI keep neglecting to come, mostly out of shame; frankly I find the texts troublingly dense and don't want to feel weak in public.
- 33a 11y agoNot really. There are a few gems here and there in the text, but overall it is a slog. CLRS is a better text book for getting up to speed in algorithms. If you are going to read it though, the volume on searching and sorting is probably the best. I didn't much like volume 1.
- deleted 11y ago[deleted]
- dpc_pw 11y agoTAOCP is like a math book, and you were hoping it will make you a better experimental physicists. :)
- brudgers 11y agoThe older editions of "Sorting and Searching" contained a lot of information on efficiently reading and writing to sequential storage devices [tape]. Don't know about the current edition. [1] That said, "Combinatorial Algorithms" is all about efficiency that is relevant today. Combinatorial problems are the sort of thing where good algorithms stomp caching, branch prediction etc. because the fundamental problems are in NP and NP/32 is still NP. Knuth has spent 50 years creating computer science that we can take for granted. But in the end TAoCP is a "little book on compilers" and if that's not relevant to one's vocation and the topic isn't intellectually interesting in and of itself then it's probably not the right book for a person. Knuth always reminds me how hard this stuff really is. Good luck. [1]: edit. The First Edition has a centerfold showing the sequences of different society's executions across multiple tape drives.
- poulsbohemian 11y agoA good portion of my undergrad CS program used excerpts from TAOCP. So yeah - there's good stuff in there, but maybe it wasn't what you personally wanted. If you've been in industry for a long time, then sure - you've probably developed expertise in areas that TAOCP doesn't cover. But if you are looking for a rigorous, broad, academic base then it is pretty solid.
- davegauer 11y agoI've read the first volume. I do not have a math-heavy background. Knuth's dry humor is great. The scope and effort put into the books are astounding. I did not learn much of practical use for my day-to-day programming. Sadly, I will probably never read the other two volumes in my boxed set. They look great on the shelf. The MIX assembly language was my least favorite aspect of the book - and I ENJOY creating and tinkering with toy virtual machines. MMIX (MIX's modern RISC successor) will probably be a lot nicer. Perhaps assembly languages are essential to demonstrate the concepts properly. And I understand the arguments against using a popular low-level language such as C. But it sure would have been nice to have a simple and readable pseudo-language for the examples rather than MIX!
- graycat 11y ago>TAOCP worth the time and effort? Early in my career, I got the first three volumes. The volume on sorting and searching was the most useful, and there the most useful was AVL trees. Next, heap sort and the Gleason bound. Sort-merge? I'd known that already, but if don't then can learn it there. Radix sort? That's what the old punched card machines did; in some cases it's faster than heap sort (doesn't contradict the Gleason bound because that bound assumes that the sorting is from comparing pars, and radix sort doesn't do that). Radix sort could be still be useful in special cases. Lists, queues? Obvious. The fast Fourier transform remains important, and some of what Knuth writes about it is good and tough to find elsewhere. Somewhere in those first three volumes are some really good summaries of combinatorial formulas, with some results not easy to find elsewhere. The volumes give some good examples of how to do the math to evaluate the performance of an algorithm -- might need to do that sometime, e.g., for some guaranteed performance in some embedded system -- and if need to do that then it's far easier to read at least the start on how from Knuth than reinvent it yourself and likely easier than from other sources. The level of clarity, precision, and quality in Knuth is about as high as those go and a great example for others. That's most of what I got from those three volumes. For the later volumes, right, I didn't bother. But, if I have a question that might have an answer in one of those volumes, then, sure, I will eagerly look.
- balls187 11y agoThere is this Hindu[1] tale[2] that goes like this: A king once solicited a scholar to read an ancient hindu text, so that the king may better understand God. The scholar goes away, and after a period of time comes to the king. The king asks "Have you read the text?" to which the scholar replies "Yes I have." The king does not believe the scholar and sends the scholar to read the text. Some time passes by, and the scholar returns. The king again questions the scholar, and again the scholar replies that he has read the text. The king sends the scholar away telling the scholar to read the text. Some time passes by, and the scholar does not return. After some additional time, the king has grown impatient and sends some men to find the scholar. When they arrive at his home, the scholar is no where to be found, and has seemingly disappeared. After studying the text so diligently, the scholar has ascended to heaven and joined God. My assumption is that once you've truly read The Art of Computer Programming, you will transcend your human form and be one with the Cloud. [1] Source: My dad, who is not the most reliable person when it comes to these sorts of things. [2] I'm paraphrasing it, as I am also no the most reliable person when it comes to these sorts of things.
- chippy 11y agoSo in today's terms the tale can be translated to: read the book and once you have you won't be asking these questions anymore.
- jlarocco 11y agoThere's always been a divide between algorithm design and analysis (covered in TAOCP and most algorithm books), and hardware implementation details like pipeline stalls, cache performance, and branch prediction. That doesn't mean the algorithm books are useless, it means they give you a bunch of options, and you have to decide which algorithms and data structures will perform best on the specific hardware you're using. But, at the same time, TAOCP is terrible as a practical algorithms book. It's perfect for graduate level algorithms classes deep diving into mathematical proofs and analyses, but for practical, "real life" coverage I prefer Skiena's "Algorithm Design Manual."
- SFjulie1 11y agoDo you need to people to tell you what to do? Asking other's advice is as stupid as judging a book by its cover. If you have studied a tad, or read books in the past, there are ways to efficiently evaluate a book: Read some pages randomly. Think 30s if you liked it. TAOCP is indigest for sure. Then take a topic for which its relevant. Read it. Did you learnt something? A) no, either you or him is an idiot. Go to B) B) Was it luck? Reproduce nth time (n being left to your choice and whatever) C) after nth iterations : - is something interesting worth learning? - can you understand the book (don't lie to yourself)? - do you like reading it? Then look at the tag price. You look at your internal evaluation and buy or not the book according to your needs. I liked reading part of this book, and i grasped the underlying context fast enough to be so bored (trying to build a consistent mapping between algebrae and code) that I never opened it again. In microelectronic you learn to draw your logic on Silicium and wire the logic... It is much more powerful and is one of the key concept of parallelism. Geometric approach. But, this is my subjective opinion of the book. Talent comes with strong balance between opinions and curiosity. If you want to understand better computers I would suggest to take a look at VHDL rather than TAOCP ... if it SUITS you. You should be the master in your choices.
- noir_lord 11y ago> Do you need to people to tell you what to do? No but if I want advice on building a wall and I'm not a builder I might ask one. If I want advice on how to make bread I'd ask a baker. There is nothing wrong with asking more knowledgeable people for advice, in fact the inverse, I've learnt skills in my life the brute force way by trial and error where just been able to ask someone who'd done it for advice would have saved me a whole bunch of time.
- engi_nerd 11y agoThe two easiest ways to learn how to solve a problem: looking at a system that does exactly what you want and copying it shamelessly, and asking someone who has already done what you're trying to do how they did it.
- tdsamardzhiev 11y ago
- hyperpallium 11y agoIs OED worth the time and effort?
- jules 11y agoNot really. The books are terribly outdated. There are far better books in each subject area. Pick up a book on a specific topic you want to learn about instead.
- egonschiele 11y agoDonald Knuth is actually a great writer and teacher. Try Concrete Mathematics instead of TAOCP, it is a shorter and easier introduction: http://amzn.com/0201558025 http://amzn.com/0201558025. It is humorous and it includes notes from past students in the margin. I really enjoyed it. Shameless plug: I wrote an illustrated book on algorithms that aims to be an easier read than TAOCP, CLRS and others: http://amzn.com/1617292230 http://amzn.com/1617292230.
- mjcohen 11y agoNot available yet.
- egonschiele 11y agoThe first chapter is here: https://manning-content.s3.amazonaws.com/download/4/b78a5a1-40c6-4577-a856-256d2fc30f5a/Bhargava_GrokkingAlgorithms_MEAP_V12_ch1.pdf https://manning-content.s3.amazonaws.com/download/4/b78a5a1-... (not the final formatting)
- rurban 11y agoI prefer the Sedgewick illustrations. Yours are targetting kids and is too verbose.
- kamaal 11y ago>>was it worth it? You are not supposed to read about any algorithm. There is nothing special about knowing how some sorting algorithm works, or any algorithm for that matter. That knowledge is no better than knowing how some war in history happened. Or remembering arcane trivial about things. Knowing how to sort a list a dozen ways, no big deal. Unless you discovered the algorithms yourself, there is nothing special about just knowing how these things work. You are supposed to learn how to discover your own algorithms, reasoning from the first principles, learning the axioms that govern the area of the problem, learn the rules, then work out step by the step, deriving new results from the results discovered a step back. You are supposed to learn how to reason about the problem. You are supposed to learn to understand the problem, state it in simple terms, learn to draw diagrams to represent it, solve sub problems. Build theories, hypothesis, question them, prove them etc. We don't do algorithm studies the right way. Even software interviews are not testing algorithm skills, they are testing algorithm memorization skills. Nothing different than those teachers who used to confuse memorizing multiplication tables with genius.
- throwaway2048 11y agoIt virtually all programming, even in stuff with tight performance constraints and high performance demands you are utilizing known and studied algorithms.
- fsloth 11y ago"You are not supposed to..." in general I agree that we should take first principles based approach always as an option - from point of view of taking intellectual pride in ones work. However, a large category of real world problems is solvable only through a combination of solutions to hard problems. If I have to solve three hard problems before I can have a complete solution is at hand - and by hard I mean months of work - my memory is so poor that the current value of a solved problem does not depend on whether I or someone elso solved it. I've forgotten the details anyway - and the only thing I have are the implementation and documentation. I have a limited lifespan but the number of interesting problems is infinite. I can't really find a calculus that says it's far more valuable to solve the known problems several times rather than new interesting problems. Because that's what you are implying (with my memory) - if never using existing solutions is preferable I would never get anything done. The same applies for most of civilizations activities. Don't confuse practicality as the opposite of love of knowledge.
- deleted 11y ago[deleted]
- soperj 11y agoReally the book series should be called the Art of Computer Science. It is basically my entire degree wrapped up in 3 books, it will not teach you how to program, just as a computer science degree will not teach you how to program, but it is an intensely interesting series of books if Computer Science is what you're into.
- dripton 11y agoI liked it a lot. I read all three books but only did a small fraction of the exercises. I had read quite a few easier algorithms books, but had never seen a good treatment of less trendy things like external sorting algorithms or random number generators. I really like Knuth's writing. Of course the drawbacks are that the books don't have recent algorithms, and you have to deal with MIX assembly rather than your favorite language. They are not easy books. At the time I read them, I had a 45-minute bus commute each way, which gave me a nice forced reading window. I don't know if I'd make it through them today, without public transportation. Too many more entertaining things to read or do at home.
- sandGorgon 11y agoTry out the Competitive Programming book - http://cpbook.net http://cpbook.net In a lot of ways, it is a faster and much more practical way to learn how to think about algorithms and data structures quickly and code them fast.
- ssijak 11y agoMy company bought the books for me. Everyone was able to order books for the value of around 100 euros, and I ordered TAOCP because it is almost timeless and it will be valid for long time. I never buy programming books (books like "learn XYZ in XYZ days") in paper because they get outdated so fast, but getting TAOCP practically for free, I did not give it a second thought..
- mathgenius 11y agoAn hour or two of reading is too short to draw any conclusions here. Choose something in the books that looks interesting to you (not necessarily in the earlier chapters) then spend a week or two working through it, and _then_ decide if it is worth it or not. I suspect that for most of us TAOCP is a rich red wine that we would sip from occasionally to get that feeling of "aha, so that's what red wine should taste like!"
- nanolith 11y agoI have read much of it. It's a project I started in my late teens, and have revisited many times over the subsequent twenty years. I have done many of the (simpler) exercises, and I have even sent in a letter detailing a small error in the text, yielding me a minor check (not to be confused with the major check) from the Bank of San Serriffe. I also got a response from Don Knuth, who corrected my letter inline in pencil. Both an awe-inspiring and humbling experience. Should you read the series? Well, that's largely up to you. There are other books that cover subsets of the material, and many books that cover algorithms not in Knuth's text. However, there are such amazing gems of knowledge in this work that it would be a shame to miss out. I'm sure that many people keep this set on their shelves for some sort of bragging rights, but I often leaf through sections for both inspiration and for entertainment. You don't _need_ to read TAoCP, but it is a refreshing read. To get the most out of the text, you will need to have a pretty good understanding of mathematics, and you will need to be willing to work out the things he describes on your own. It's not a passive reading experience, like reading most fluffy books found in the "computers" section of the average bookstore or library. It is an active experience, like reading a mathematics textbook. There will be parts that challenge your conceptions, and there will be parts that will take several attempts to fully understand. Then come the exercises, some of which are still open problems in Computer Science. It is a worthy endeavor. I recommend it.
- sn41 11y agoI am an academic, so slightly offtopic from the original post, but still may be relevant. I think TAOCP is probably not worth reading cover to cover for even academics let alone practical programmers, but definitely having it by your side for reference. The important thing that distinguishes the book is this: the attention to detail. Knuth is one who famously shuns email to "get to the bottom of things", rather than stay "on top of things". I am trying to get into an area called pseudorandomness, and Knuth vol 2. 3rd edition has an excellent treatment of the subject in all its incarnations. The details that are in the book beat even the original research articles where the results first came in. So I refer to Knuth first to see if it is there, and then go to the research articles! Bottom Line: To get the details correct, trust Knuth, rather than a random blog article on the web on the same topic.
- pajop 11y agoit's worth reading just for one of the best book in-jokes ever - see the introductory part "Notes on the Exercises" of Volume 2 "Seminumerical Algorithms" 3. [M50] Prove that when n is an integer, n > 2, the equation xn + yn = zn has no solution in positive integers x, y, z. Knuth's book was published in 1973. The initial solution to this exercise was solved by a then Princeton professor in 1993 and was finalized by same professor and his former student by 1995.
- kjs3 11y agoIt's kinda important to note here that the "M50" designation indicates that the excercise is an "unsolved research problem". It's not an in-joke; Knuth is presenting unsolved problems with the intention that the student would consider trying solving them.
- pajop 11y agobtw, if you didn't find an in-joke [1] funny [2][3][4][5] then it's probably because of a very good reason :) Knuth himself found it funny [6] [1] https://en.wikipedia.org/wiki/In-joke https://en.wikipedia.org/wiki/In-joke [2] https://groups.google.com/forum/#!topic/alt.folklore.computers/qfwJTPPFdsw https://groups.google.com/forum/#!topic/alt.folklore.compute... [3] https://www.reddit.com/r/ProgrammerHumor/comments/38gt65/wasnt_expecting_my_biggest_laugh_of_the_day_to/ https://www.reddit.com/r/ProgrammerHumor/comments/38gt65/was... [4] http://texthook.com/blog/2013/07/01/reading-knuth/ http://texthook.com/blog/2013/07/01/reading-knuth/ [5] http://tal.forum2.org/story_45 http://tal.forum2.org/story_45 [6] http://www.tug.org/TUGboat/Articles/tb17-1/tb50knut.pdf http://www.tug.org/TUGboat/Articles/tb17-1/tb50knut.pdf (page 10)
- kjs3 11y agoYou're of course right; I should have considered my response more. I suppose it would be more accurate to say the M50 problems are not only an in-joke in the sense that one always hopes for a George Dantzig moment. But clearly the inclusion of something like FLT has to be done with a at least a little chuckle from the author.
- QuadrupleA 11y agoAppreciate all the feedback and discussion, been sneaking peeks at the comments throughout the day - I'm still within the time window to return the boxed set thankfully, and haven't spilled coffee on them yet, so I'll probably go that route. Some of the other resources people have suggested sound like they'd be a better use of my study time.
- mthorbal 11y agoMany years ago, I purchased TA0CP because I was stuck. I simply could not get a tiny 8-bit microcontroller to linearly search a lengthy data array in real time. I found the solution in the preface of the work! Simply put the value that you are looking for at the end. That way, you can eliminate checking for the end of the array in the search loop. So, at least for me, I got mymoney's worth after a couple of pages.
- zvrba 11y agoWhen I'm bored I pick a random section and read it. I was really fascinated by the section on sorting networks for example. The real gems are the exercises and answers to them; there's at least as much useful/applicable stuff as in the main text. I tried to solve them, but found myself unable to proceed with them if difficulty was > 20, even if I understood the concepts. I have no idea on how to attack them. (Even non-mathematical ones.) IMHO, TAOCP needs "Volume 0" which would teach you problem solving in this particular domain. (No, "Concrete mathematics" is not it. That book is, IMHO, awful: many problems depend on having tricks up your sleeve.) Any tips on how to approach exercises which seemingly don't have a lot to do with the preceding text?
- cgag 11y agoI haven't read TAOCP, but for those things you mentioned, Computer Systems a Programmer's Perspective is great, especially if you're thinking the way you seem to be about how you can exploit these things rather than how they work in depth.
- eyan 11y ago> So for those who are practical programmers and have gone down the Knuth TAOCP rabbit hole There's the rub. TAOCP is Computer Science. "Practical programmers" aren't even engineers. So yes. The books for your intended purpose aren't worth anything. It will have worth when you are writing something 'serious' like compilers, kernels, or complicated games. CRUD apps, nah.
- mseebach 11y agoI don't know if it's intended, but I picked up a whiff of condescension from this comment. I think it's worthy of celebration that the field has come so far that we can have such a thing as "practical programmers" who achieve very significant things in their respective business fields, without having to know much if any theoretical computer science at all. Slight hyperbole: the CRUD app is basically the indoor sanitation of this century. This is facilitated by lots of brilliant people who DID read and understand TAoCP (or equivalent), and it's a credit to their brilliance that so many get so much done without reading it.
- ajarmst 11y agoI sometimes think of Computer Science (in the classical theoretical sense---and Knuth is a towering figure in that domain) as having a similar relationship with programming as that of Mathematics to Engineering. A basic foundation in the theoretical background is very helpful, possibly essential, to professional work, but a deep understanding of theory is unnecessary. That said, those engineers that have a deeper mathematical foundation can realize important benefits to the quality of their work. Similarly, a rich immersion in abstract computer science is not necessary to programming, but its presence can be of great value. Being aware that a given programming problem maps to a well-understood class of algorithms with known performance and correctness enables elegant solutions.
- ajarmst 11y agoI should note that, while TAOCP is absurdly important in CompSci, it's probably not a good starting point. I'd recommend Corman's book on algorithms first, and maybe getting your feet wet with Knuth's Concrete Mathematics ( if only as a more gentle introduction to his style).
- Arnt 11y agoI read all three volumnes and think it's great. In a sense it's all irrelevant today. How many of your colleagues mentioned O() in any of the past five standups? Add a load balancer and scale up by adding instances, that's today. Don't even profile, much less understand. However, if you're the kind of person who thinks hard about abstract matters and would like to encourage that side of yourself, then you might want to read that. You'll probably find it hard, particularly if you're a "ruby programmer" or "java programmer" rather than a "programmer", because Knuth is rather the opposite. Interestingly, I have found that some parts of the book offer much more useful information than others. All offer the same thorough, intellectual approach, but while much of what volumes 1/3 say is useful for a modern programmer (but not for a modern <language> programmer), what I learned in volume 2 hasn't been of much use to me. Today's languages and libraries offer both math and data structures. But in practice, for whatever reasons, they seem to have liberated me effectively from caring about seminumerical algorithms, while I still think about data structures every week. Knuth writes about making things fast with drum memory. I don't have drum memory, but making my data structures fast within the real-world constraints remains a topic, and somehow it's the same topic. Knuth also writes forty pages about floating point, but when I use floating point I don't worry about that part in the same way. The libraries do what I need and their internal problems rarely or never leak up to me. (Well, at work we do occasionally share "14.000000000002%" of revenue... but it's not a problem. Insignificant.)
- ternaryoperator 11y agoA theme that runs through some of the comments here is that TAOCP is not worth reading straight throught, but it makes a good reference work. In the last 10 years, I've used it as a reference exactly once, when I peeked into Vol 1 on semi-numerical algos. I found it as well-written as I remembered, but requiring heavy slogging to find out one detail. Ultimately, I found what I needed online. I would argue that great as TAOCP is, it's rarely going to serve many needs even as a reference.
- lionize 11y agoThere is an argument that it hasn't aged well and that with the advances of programming language design, libraries and hardware it is more of a historical look at the early days of programming. I disagree though as it gives the budding programmer a good foundation. I would also suggest SICP books/lectures. Also learn to program Visual Basic in 5 hours :-p
- rbehrends 11y agoTAOCP is very much worth reading, but it does emphasize the "science" part of "computer science". That's not 1960s minutiae, either, that's just academic rigor. TAOCP creates challenges for many readers, because it does address most problems with an enormous amount of depth and breadth (but at the same time, offers a pretty exhaustive treatment of many topics) and requires a level of mathematics that may be daunting for beginners. If you want a more accessible text in the same vein, you may want to give Mehlhorn's and Sanders' "Algorithms and Data Structures: The Basic Toolbox" a whirl, as it is freely available online [1]. It is a text aimed specifically at undergraduates and isn't as ambitious as TAOCP, but it still is something that may require a fair amount of effort to follow. [1] https://people.mpi-inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Sanders-Toolbox.pdf https://people.mpi-inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Sanders...
- timwaagh 11y agoIt was worth the 25 euro's my dad spent on them i guess (bday gift it was on sale). just to look at it sometimes and i even read some stuff. but its hard. if you want to learn something for real pick any other book.
- kyberias 11y agoI have TAOCP in my bookshelf. It's actually my second set of books since the first set was stolen from my work-place. I also have other books I haven't read.
- pakled_engineer 11y agoI use TAOCP on a regular basis where I work, I started writing DSLs for industrial systems then learned from TAOCP how to optimize memory of these embedded systems. We leaf through the pages whenever we can and always find something relevant to what we're working on. We also used just a few LOC for hand rolled Knuth in a customer app field engineers use to quickly find documentation that is so fast and accurate we get offers to buy it. As a result these corps all keep their ancient embedded systems that would cost multi millions to replace as we keep making them faster and more reliable. Knuth is also a fan of abstracted programming languages like Literate programming which he claims without it he wouldn't have been able to create a lot of the exercises in recent TAOCP volumes so anybody declaring that if you're "just" a Java programmer you won't get any use out of the books are likely incorrect.