Please create an account to participate in the Slashdot moderation system


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. ×
Books Programming

Ask Slashdot: Have You Read 'The Art of Computer Programming'? ( 381

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?
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Have You Read 'The Art of Computer Programming'?

Comments Filter:
  • by Anonymous Coward on Sunday December 04, 2016 @09:16PM (#53422503)

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

    • by lgw ( 121541 ) on Monday December 05, 2016 @12:36AM (#53423161) Journal

      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.

      • >CLR (now CLRS)


        Common Language Runtime?
        Calcium, Lime & Rust?

        • by lgw ( 121541 ) on Monday December 05, 2016 @01:29AM (#53423273) Journal

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

          • by bzipitidoo ( 647217 ) <> on Monday December 05, 2016 @03:00AM (#53423433) Journal

            CLR is Introduction to Algorithms by Cormen, Leiserson and Rivest. The S in CLRS is for Stein, who joined the team for the 2nd edition. When CLR came out in 1990, it was hailed as the best algorithms textbook ever, and what an algorithms textbook should be, a huge jump in readability and clarity over the not wholly satisfying existing algorithms textbooks. It uses pseudocode, instead of a real programming language. Allowed the algorithms to be presented cleanly, 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. Don't have to declare any variables, or figure out how many elements an array needs.

            The Abelson and Sussman textbook, Structure and Interpretation of Computer Programs, uses LISP (actually Scheme). There are quite a few LISP fanatics who passionately feel it is still the best programming language made, citing such reasons as the simplicity of writing an interpreter for it. However, that textbook is pretty difficult. The authors didn't appreciate how hard recursion can be for many students to understand, and LISP and functional programming in general uses recursion so heavily it's the proverbial hammer for every nail of a programming problem.

            Since then, programming languages have improved. Still not good enough for the textbook, but closer.

            • 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?

              I think I'm lost. We use a newer shiny shiny that shows us to do something without showing it done safely and it's better because people will magically include the necessary safety checks and our new algorith

              • by shaitand ( 626655 ) on Monday December 05, 2016 @03:33AM (#53423509) Journal
                Since the safety checks are language dependent and aren't actually related to the algorithm logic, yes, that is better. This isn't a copy and paste recipe book. Learn the algorithm logic from the book then write your own implementation in the language of choice.
              • by luis_a_espinal ( 1810296 ) on Monday December 05, 2016 @09:37AM (#53424707) Homepage

                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.

      • The little amount of maths that's in there is not that difficult to understand. And if you skipped it, you would be still learning a lot. Not reading taocp because of maths is just an excuse.
      • by ShanghaiBill ( 739463 ) on Monday December 05, 2016 @02:26AM (#53423373)

        Personally, I don't think he does a great job explaining algorithms .... It is an exhaustive catalog, but it's not a great learning tool.

        I agree with all of the above. There are better books. But criticizing TAOCP is like saying the emperor has no clothes. The series is difficult to understand, and everyone thinks it is their own fault for not being smart enough, rather than that the books actually aren't very good.

        Disclaimer: I own the entire series, and keep them in my office to impress people, but I haven't actually opened them in the last 20 years.
        Additional Disclaimer: I loved Don's "Concrete Mathematics" book ... for the humor as well as the math. I keep it in my office to impress people too.

  • by mykepredko ( 40154 ) on Sunday December 04, 2016 @09:24PM (#53422547) Homepage

    I read the first three books in University and did examples from the first two when I started debating with myself, friends and professors, is it better to have the ultimate reference or be able to create code on your own as the requirements come up?

    Over the thirty plus years since, I'm happy to say that volume two and three have gotten pretty ratty as I've used them as references (along with "Programming in C", 2nd edition) so I feel like I've struck the right balance (for me) between reading them, using them as reference and creating my own code/algorithms.

  • by 93 Escort Wagon ( 326346 ) on Sunday December 04, 2016 @09:25PM (#53422549)

    Although she preferred his other works, like The Land Before Time and Anastasia.

  • Just buy it (the entire and updated book set) and read it ;) and continue to use it as a permanent reference for whatever you want to do with programming...
  • by guruevi ( 827432 ) <> on Sunday December 04, 2016 @09:27PM (#53422563) Homepage

    It's really great reading if you do stuff like program low-level (think C, Assembler), efficient programming or do stuff close to the hardware level (such as microprocessors). It describes the very low level of a program and a computer.

    If you're into a higher level of programming (Java, C#, Python etc), unless you're building libraries for it, it is probably going to confuse you, most of the 'hard stuff' is (double precision, floating point, sorting and searching through lists ...) abstracted away. Obviously 'someone' has to know how it works in the end, someone has to write the compilers, I haven't started on the rest of the volumes because that's not "me".

    You should understand how computers work before you start reading these, I've been in the 'business' for 20 years, I've read it 3 times just to get a basic grasp on the first volume.

    • It's also well worth the effort (and it is a lot of effort) to read the third volume, Sorting and Searching. The second volume (Seminumerical Methods) may be useful if you do certain kinds of work, but Fundamental Algorithms and Sorting and Searching are worth almost any professional programmer's time.

      I have to admit I haven't bought 4A yet.

      I really hope that Knuth is grooming someone to take over the work of completing the full set when he dies, or becomes unable to continue.

    • by TheRaven64 ( 641858 ) on Monday December 05, 2016 @09:21AM (#53424577) Journal

      It describes the very low level of a program and a computer.

      No it doesn't. It describes the very low level of a program running on a computer from 30-50 years ago. The lessons that it teaches about algorithmic complexity are still valid, but the low-level stuff is not. Once you get to limits of the implementation, rather than of the algorithm, artefacts of caches in pipelines are far more important to performance. Not only will you not find, for example, Hopscotch Hash Tables in TAOCP, you also won't find an explanation of the underlying reasons for their performance.

  • by xxxJonBoyxxx ( 565205 ) on Sunday December 04, 2016 @09:27PM (#53422569)
    I read the three volumes like I read any book in SkyRim: I opened the cover, got my +1 level in computer science, dropped it and hit it with a fireball.
  • It's definitely worth reading, and working through at least some of the exercises. It is an excellent example of rigor, depth, and attention to detail. You may not have time to work like that every day, but it's very useful to be capable of doing it and to have a good mental model of what it's like.
  • Parts (Score:5, Informative)

    by Erich ( 151 ) on Sunday December 04, 2016 @09:29PM (#53422577) Homepage Journal
    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.
  • I thought everyone learned from a Dummies book and building a few cell phone flashlight apps.....
  • I used Vol. 2 to improve the multiply algorithm in an open source program.

  • I have read some (Score:4, Interesting)

    by hgriggs ( 33207 ) on Sunday December 04, 2016 @09:35PM (#53422611) Homepage

    I have them. I have studied small parts of some of them. I have been delving into them over 30 years.

    For day to day programming, I do not need or use the detail in those books.

    At various times in the past, I have delved into library writing, and then they were very helpful, mostly in understanding issues and problems that I had not thought about. But I think time has moved on. Hardly anyone needs the details in those books, and in many cases, some classes of problems are well solved.

    Looking back, I am glad that I studied some parts. But today I would not recommend them. Unless you really wanted to look back at history.

  • by Anonymous Coward

    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

  • I have, not worth it (Score:5, Informative)

    by AuMatar ( 183847 ) on Sunday December 04, 2016 @09:50PM (#53422685)

    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.

  • Maybe (Score:5, Interesting)

    by kwerle ( 39371 ) <> on Sunday December 04, 2016 @10:09PM (#53422729) Homepage Journal

    I wasn't sure if I'd read 'em. I know a friend/colleague (who I regard highly) who has - and I think he thinks highly of them. But he also has terrible taste in movies.

    A quick google search landed me at []

    I have not read it.

    I've been coding professionally for 25-30 years, depending on how you count. I studied CS in college. I've read a few outstanding books on the subject since then.

    I don't have the patience for these, and I suspect I'm not going to miss out on much.

    On the other hand, I long ago came to the conclusion that I'm really not interested in low level code. Give me a nice high level language with nice high level functions and features and I'm a happy coder. That's not to say that I don't understand O notation or the costs behind the complexity - but it is to say that I know when to use a drill and when to use a power saw - but I don't want to build either of 'em.

    Maybe you're into the nitty gritty. Or maybe you like bad movies.

    Check your local tech library and see if you can check out a copy. Or ebay 'em for $20-40/volume. Or if the pdf strikes your fancy, maybe take the plunge.

    • For most development projects, I would agree that going into the nitty gritty can seem like overkill. But, having a core understanding of low level programming can make a huge difference in application performance. The third book "Sorting and Searching" should be required reading for anyone who plans on getting involved with databases, even if they only plan on being a dba.

      You can do a lot with high level programming languages, but if you skip assembly or C programming for at least a background on what is h

  • by Ungrounded Lightning ( 62228 ) on Sunday December 04, 2016 @10:10PM (#53422731) Journal

    My wife and I each had a copy of the first three volumes when we married. Yes, there are female computer nerds. B-)

    I first encountered it when assigned one of the volumes as a text back in 1971. Of course the class didn't consist of learning EVERYTHING in the volume. B-)

    I use it from time to time - mainly as a reference book. Most recently this spring, when I needed a reference on a data structure (circular linked lists) for a paper. I've found it useful often when doing professional computer programming and hardware design (for instance, where the hardware has to support some software algorithm efficiently, or efficient algorithms in driver software allow hardware simplification).

    I don't try to read it straight through. But when I need a algorithm for some job and it's not immediately obvious which is best, the first place I check is Knuth. He usually has a clear description of some darned good wheel that was already invented decades ago, analyzed to a fare-thee-well.

    I only see him about once a year. He's still a sharp cookie.

  • I've read the 1973 editions, cover to cover. I skimmed a few fasciles. Haven't kept up since then.

    Do I recommend it? You bet I do, just like I recommend Structure and Interpretation of Computer Programs, The Mythical Man-month, and The Psychology of Computer Programming. That's not to say you have to have read classics like these to be a good programmer, but if you haven't internalised a lot of the material that's covered in books like these, I question how much you care about what you do. And if you don't

  • by rowdysailor ( 413749 ) on Sunday December 04, 2016 @10:14PM (#53422745)

    We should all chip in and get a complete set for the US Patent office. It might help them get rid of some bad patents they have issued over the years.

    Or if you say you are using a computer in a patent app and don't cite Knuth as prior art for something you get tossed for that as well.

  • While I haven't read the books, and doubt I ever will now, the content is similar to the uni course I did in computer science back in the 80s. Knuth covers everything in higher detail than I can recall being taught, but I'm pretty certain my foundations are just fine. It may just be that I'm forgetting some things too, it's been almost 30 years now for most of it.

    I might go back and revise a topic or two in those books or a similar source if I felt I needed a refresher. For most cases though, what I can rec

  • Folks, we live in an age where programmers declare integers that are going to count from 1...10 as LONG INTEGERS, eating 8 bytes of RAM, where only 1 byte is needed.

    We live in an age of cloud computing, load balancers, containers, and distributed databases with stored procedures. When code runs, you have no idea where it is running and how it is spread out over cloud services. Most of the time you don't even know what country the physical box is in.

    I have a pure CS degree, but as long as we can keep makin

    • by eagl ( 86459 )

      Yes but. I used to declare variables overly large as a kludge to help out when error-trapping was consuming too much time and I knew that the compiler wasn't good with overflows. So I'd do input error checking up to the point where it started to take too much time, then declare a variable larger than reasonable input would be, and then attempt to trap and reject input at a length between reasonable input values and the declared variable size. Declaring a variable just larger than the input buffer was one

  • Vol. 1-3 were my bible during my early programming career and they, along with vol. 4, have an honored place on my bookshelf. I still refer to them to this day, 30 years after I got the first volumes.
  • The modern version is much more of a reference than textbook. While exercises still are part the book, it really for testing knowledge. Also, the field has just exploded and the task is really daunting. Satisfiability is an example, the current fascicle is 320 pages, but a more in depth look at the problem could run to twice that much and more. And there is new work being done on the topic every day.

    Frankly, less and less programmers will need it, as it is easier and easier to create and use algorithmic lib

  • I don't think I've read any college text book cover to cover. I open up TAOCP when I need to get into the theory on a particular topic.

  • As a graduate student, I bought and used the first three volumes of these books when they first came out. At that time, computing resources were much more limited and much more expensive than they are today. Knuth's volumes made me appreciate the value of algorithms and the logical thinking needed to develop them. As a programmer, the turnaround time on submitting computing jobs to your computer center could be long, so it was in your best interest to exert some self-discipline and check your code carefully
    • The interesting part is he doubled the reward for every error found, and surprisingly he hasn't had to write cheques for much money the last time I checked.

  • Back when I was at AOL in Vienna, VA, there was a bookstore called Computer Literacy Bookstore, a few doors down from the headquarters of Ringling Brothers & Barnum & Bailey Circus (who annually would show off their elephant-de-jour).

    I bought the first two editions there the moment I became aware of them. They're signed in pencil by Knuth himself. The fact that he used pencil I found amusing.

    I bought the third edition, which was a huge, huge event as it was much anticipated, and enjoyed it better

  • I did however read the Notepad help file.

  • If you're working for Oracle and coding the Oracle database and are looking for an algorithm to squeeze a bit more performance out of the engine, go ahead and buy the book, you might find something in there. But most programmers are using sets and dictionaries in their chosen programming language that has a decent implementation of algorithms and won't be helped by some algorithm which might squeeze a few more cycles out of the computer but nobody will reward you for. The Knuth book is for high fliers and

  • by ihavnoid ( 749312 ) on Monday December 05, 2016 @12:51AM (#53423195)

    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.

  • by aglider ( 2435074 ) on Monday December 05, 2016 @01:20AM (#53423249) Homepage
    And You should as well. It would give you the right knowledge to understand the whys and the hows.
  • As surveys go, it would be as good as most of the recent ones.

    Anyway, I've never read even one volume of the series, though I'm pretty sure I consulted it at various times. It was certainly available in the university libraries where I was teaching or studying. Also I remember seeing it in the research library when I was supporting the researchers. However, I can't really remember any details after all these years. The place I should have been introduced to it was when I was earning my CS degree, but I don'

    • by shanen ( 462549 )

      Just remembered another one. I think Knuth also collaborated on a textbook called Concrete Mathematics , which I purchased but never finished reading (so it isn't in my records). Pretty sure I gave it to one of my professors when I finished my last stint as a student...

  • by dcollins117 ( 1267462 ) on Monday December 05, 2016 @03:00AM (#53423437)

    It's not like a novel you read front to back. If you need an algorithm you look it up.

    I had to write a math library for a DSP that didn't have compiler support yet. TAOCP came in handy then. The parts I did read I went over again and again and once again. It wasn't fun by any means.

/* Halley */ (Halley's comment.)