Slashdot Mirror


Ask Slashdot: Have You Read 'The Art of Computer Programming'? (wikipedia.org)

In 1962, 24-year-old Donald Knuth began writing The Art of Computer Programming, publishing three volumes by 1973, with volume 4 arriving in 2005. (Volume 4A appeared in 2011, with new paperback fascicles planned for every two years, and fascicle 6, "Satisfiability," arriving last December). "You should definitely send me a resume if you can read the whole thing," Bill Gates once said, in a column where he described working through the book. "If somebody is so brash that they think they know everything, Knuth will help them understand that the world is deep and complicated."

But now long-time Slashdot reader Qbertino has a question: I've had The Art of Computer Programming on my book-buying list for just about two decades now and I'm still torn...about actually getting it. I sometimes believe I would mutate into some programming demi-god if I actually worked through this beast, but maybe I'm just fooling myself...

Have any of you worked through or with TAOCP or are you perhaps working through it? And is it worthwhile? I mean not just for bragging rights. And how long can it reasonably take? A few years?

Share your answers and experiences in the comments. Have you read The Art of Computer Programming?

10 of 381 comments (clear)

  1. Unfortunately no and I have a reason by Anonymous Coward · · Score: 4, Informative

    Unfortunately no and I have a reason:
    Reading those books requires high degree of mathematical sophistication, particularly, knowledge of complex analysis, which I lack.

    1. Re:Unfortunately no and I have a reason by lgw · · Score: 5, Informative

      Reading those books requires high degree of mathematical sophistication, particularly, knowledge of complex analysis, which I lack.

      They're just algorithms textbooks. They're hard to read because of when they were written, and the accompanying style. More like pseudo-assembly than high-level pseudo-code.

      But, hey, if you want to optimize your search algorithm that uses tape as storage, to take advantage of the new-fangled tape drives that can write backwards as well as forwards, it's the book for you! (Yes, that was really a thing, and an algorithm you'll find in Volume 3: Sorting and Searching.)

      Personally, I don't think he does a great job explaining algorithms. I once needed to look up O(n) median for something, tried to understand it from Knuth, gave up on the cryptic text, and understood it right away from CLR (now CLRS). It is an exhaustive catalog, but it's not a great learning tool.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:Unfortunately no and I have a reason by lgw · · Score: 3, Informative

      The "R" is Rivest, who invented the algorithm for O(n) median, and some other stuff.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Unfortunately no and I have a reason by Anonymous Coward · · Score: 2, Informative

      search algorithm that uses tape as storage, to take advantage of the new-fangled tape drives

      Such co-location issues are actually still very relevant if you consider cache optimisation, or even GPU implementations of algorithms.

    4. Re:Unfortunately no and I have a reason by luis_a_espinal · · Score: 4, Informative

      presented .... without any boilerplate code, overhead, or worries about limitations, no need for tedious checks for array out of bounds, numeric overflow, or out of memory, or invalid input.

      Wait - did I read that correctly? "without any boilerplate code, overhead, or worries about limitations, no need for tedious checks for array out of bounds, numeric overflow, or out of memory, or invalid input" = improved textbook? Aren't these the attack vectors used by malware and viruses today?

      Everything you mentioned are supposed to be a given. A person who needs explicit indication of them are not at the level required to use a book like CLRS. I don't mean it as an insult, but as an observation.

      Moreover, many of the checks you mention are handled by constructs and idioms that are language dependent. For example, boundary checking in C will be different from, say, Ada or Java, let alone something like Ruby or LISP.

      Also, when you are stuying algorithms at that level, you are assumed to have a certain maturity that makes reference to such things irrelevant. Think of it like this: If you are learning how to solve quadratic equations, you do not need a lesson in adding fractions, do you?

      Same principle applies here. When you are taking a book like CLRS, it is to study the mathematical properties of algorithms.

      I would say that a there is a more hands-on book that directly addresses these concerns: O'Reilly's Algorithms in a Nutshell. This is a really nice pocket book.

    5. Re:Unfortunately no and I have a reason by pthisis · · Score: 3, Informative

      I constantly switch between the major C languages (not a major feat), C, C++, Java, C# and my resume has Visual Basic, Ada, Python, Perl, Assembly, FORTRAN, Lab Windows

      A lot of these languages are kind of samey-samey; the mind expansion he's talking about comes from working in languages that use very different programming models that make you approach problem-solving in new ways. Try adding, say, Haskell (or SML or ELM), Forth, and Prolog to the list, for starters.

      --
      rage, rage against the dying of the light
  2. Parts by Erich · · Score: 5, Informative

    TAOCP is a great reference. There are some really important things that are pretty good for someone who wants to be a professional software engineer.... 0) understanding how algorithms execute on a processor. While MIX is behind the times, (and MMIX is ahead of the times in many ways) understanding how an algorithm executes on a processor is important. I think Knuth really did the right thing in not selecting the language of the day. 1) algorithm reference. If you need to understand an algorithm, or choose between a family of algorithms, it is often a great place to find the art. 2) The humor is pretty good, at least to me. Done get me wrong, it's on a humor book, but there is wittiness and puns and some running gags... 3) It's always good to have some humility, and reading TAOCP always makes me a little more humble. It's worthy of a place on your shelf.

    --

    -- Erich

    Slashdot reader since 1997

  3. Yes, and it's good. but not gospel by Anonymous Coward · · Score: 2, Informative

    It depends on what you mean by "work through it". Do all the exercises? Some are unsolved problems, so that's not terribly realistic.

    There's nothing in the books that's not also discussed elsewhere (with the possible exception of the very thorough discussion of out-of-core sorting with tapes, which is a bit unusual these days), but it takes quite a few other books to equal the series.

    I have read it at length, and it's definitely full of good stuff to know, but it really depends on your field. It's still dedicated to single-threaded algorithms, so concurrent and functional data structures aren't touched. If you're slinging matrices around for computer graphics, not so much.

    But I definitely feel that it covers a greater span than, say, the CLR textbook Introduction to Algorithms.

    Why don't you read some in a library (or download some of the torrents floating around) and see what you think? It's a reference book, not a mystery novel which isn't nearly as good if not read in order.

  4. I have, not worth it by AuMatar · · Score: 5, Informative

    Don't get me wrong, Knuth is a genius. If you need to do deep research on sorting algorithms, definitely read it. If you want to do CS research and need to learn how to read research papers, its a good start. But you aren't going to get any deep insights on how to write a good program from it. Its too academic and far too focused on deep research. And even for the topics it does cover, unless you want to do research on how to really optimize the hell out of them you're better off using tutorials written for a more practical level.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  5. Yes, most of the 3 volumes by ihavnoid · · Score: 3, Informative

    I started reading them around 2001 and went through the three books, a little bit at a time. Went through most of the exercises with 30+ difficulty, but couldn't really solve all of them.

    A lot changed to myself - back then, I was a newbie undergrad programmer with undergrad-level math skills. Fast forward 15 years, I went through grad school and then couple of years of industry experience. My main programming languages moved from C++/Java to VHDL, then moved on to SystemC and SystemVerilog, and back to C++ with a bunch of bash scripts.

    So, did I get to use the knowledge that I gained from reading it? Not much, I didn't even have to write a single data structure or algorithm because there are perfectly good (or at least, good enough) libraries for most of the issues that I had to deal with. Neither did I have a good usage of the math courses I learned (remember things like Laplace transformation or L-U decomposition?), nor did most of the non-engineering courses I took helped much. Still, all of them helped shape myself on understanding the world and helped gaining problem-solving skills.

    Would I recommend it to other people? Depends, if you find your data structure and algorithm textbook easy enough and you want more challenging stuff, TAOCP is a perfectly good motivator to train yourself to solve complex problems. However, I think there are other ways to train complex problem-solving - e.g., a lot of advanced math/physics textbooks. However, for people who tend to fall asleep once they see those weird characters (and would rather live with pseudo-assembly code) TAOCP is a much better solution.

    If you want to learn practical programming skills, then don't bother reading.