News for hackers. Stuff that matters.
Re:Ask HN: How do I choose the right resource to learn CS fu... by brudgers on Tuesday December 31, 2019 @09:22AM (#21921147)
+ The foundation of computer science is Knuth's The Art of Computer Programming. Everything else is footnotes. Knuth is hard. And easy. And everything in between. You won't understand all of it. But you'll have to be ok with not understanding all of CS anyway. Nobody does. You can spend your time searching for a silver bullet. Or you can just read the manual. Knuth is the manual.

+ Bach's The Design of the Unix Operating System describes how operating systems and file systems work. Even Windows describes it's similarities and differences using the same terminology.

+ Hellerstien's Berkeley CS 186 Intro to Databases lectures. Databases get more love at Berkeley than elsewhere. https://archive.org/details/UCBerkeley_Course_Computer_Scien...

Re:Ask HN: How do I choose the right resource to learn CS fu... by nindalf on Tuesday December 31, 2019 @11:00AM (#21921909)
This is a poor suggestion, IMO.

OP is trying to get into CS, so they need something that's clear and approachable. By your own admission, it's possible even for experienced people to be stumped by TAOCP. It's simply too vast and too difficult for a beginner to finish. This fetishizing of difficult things doesn't help anyone, least of all people trying to get into the field.

The failure mode to watch out for here is not OP getting developing a small misconception about something, but that he finds the field too intimidating to continue.

It's far more likely that a beginner has success with the other suggestions from this thread - like Nand2Tetris, which is clear, explains the fundamentals, is accurate and most importantly, fun.

Re:Ask HN: How do I choose the right resource to learn CS fu... by brudgers on Tuesday December 31, 2019 @11:25AM (#21922149)
Knuth is clear and approachable. It's just not dumbed down. The theory that a beginner should 'finish' requires dumbing down. And then they haven't really finished anything. At it's core, your position infantalizes the OP instead of treating them as a full fledged intellect simply lacking knowledge.

Nand2Tetris is a great resource. There are lots of great resources: Let's build a compiler, SICP, Paradigms of Artificial Intelligence: Case Studies in Common Lisp, Code Complete, Code, etc. and on and on. What to choose is the OP's problem.

Nothing is as robust as Knuth. It's stood up longer than most Hacker News readers have been alive. And is still keeping up...or rather still at the sharp edge. The first edition of Volume I is more than fifty years old and still entirely relevant. Binary trees, queues, and stacks haven't changed. Neither has the math.

What has changed is that teaching computer science has become an industry. It perpetuates itself via gatekeeping. By withholding knowledge. An industry that parcels out knowledge in semesters. But CS is a lifetime field...Knuth started in 1962.

Re:Ask HN: How do I choose the right resource to learn CS fu... by panpanna on Tuesday December 31, 2019 @10:29AM (#21921600)
Unpopular opinion:

I have _never_ had any real use of TAoCP. I own all volumes and have really tried to make use of them but they feel more like a trivia book than something you can actually use in your work.

Sure, it's cool to own and recommend it but have people actually used it?

To end on a more positive note: I highly recommend "Introduction to Algorithms" by Cormen et al. Not as cool but very useful.

Re:Ask HN: How do I choose the right resource to learn CS fu... by nindalf on Tuesday December 31, 2019 @11:27AM (#21922166)
> Sure, it's cool to own and recommend it

That's what it exists for. To build the street cred of people who own it and have read it. Notice how no one who has read it comes back with a comparison of TAOCP and CLRS. For example "learning bogosort from Knuth instead of Cormen is better because Knuth gives you xyz insight into it". No, they simply think it's better because it's harder.

A rough comparison is On the Origin of Species, which is a solid foundational text without being too arcane while Philosophiæ Naturalis Principia Mathematica is not. No sane person suggests that to learn the Newton's laws of motion you need to learn Latin and then read Principia (except the people who fetishize difficulty). Just read Resnick and Halliday instead.

By no means am I downplaying Knuth's genius. He is a stalwart without whom our industry would be worse. But TAOCP is not a good foundational text because it's not approachable.

Re:Ask HN: How do I choose the right resource to learn CS fu... by svat on Tuesday December 31, 2019 @03:06PM (#21924265)
> a comparison of TAOCP and CLRS

The two are hard to compare, IMO, because their approaches and intended audience are different. CLRS is an undergraduate/graduate textbook on algorithms, where the authors have selected a broad range of topics based on things like their suitability for teaching or coursework. TAOCP on the other hand treats a narrower (and rather different) set of topics in greater depth, each section being essentially one person's excellent distillation of all published literature on the topic, passed through a tasteful interestingness+usefulness filter, and presented in expository style. To expand on that:

* CLRS treats algorithms as an academic subject in its own right, while Knuth is more concerned about what is actually useful to a programmer who is interested in writing efficient programs. For example, CLRS has an entire chapter on Fibonacci heaps (and the 2nd edition also had one on binomial heaps), which are great theoretically (amortized constant time for some operations), but impractical to implement and (because of the constant factors) hardly worth using in practice. In TAOCP you'll not find them mentioned. (Though there are Fibonacci trees, the search trees that arise as a result of a simple and easy-to-implement algorithm called Fibonaccian search.)

* Compare the table of contents: https://en.wikipedia.org/w/index.php?title=Introduction_to_A... versus https://en.wikipedia.org/w/index.php?title=The_Art_of_Comput... (Knuth wrote down the table of contents in 1962 and has been writing to it ever since; the ToC of CLRS is of course a function of present-day fashions among algorithms researchers.)

* Roughly, CLRS, like algorithms researchers, treat algorithms as a branch of mathematics, following the idea-theorem-proof structure (and sometimes overdoing it: https://www.goodreads.com/review/show/155959101), writing only pseudocode, etc. It is possible to go through the entire book without ever writing a program or even feeling the urge to write one. (Not saying that's wrong.) Your thinking stays at a uniform level, roughly the "idea" level of thinking about the algorithm and what it does, proving things about it, etc. In TAOCP it's common to find an idea/algorithm described on one page informally, then a page later (rarely, when warranted: https://news.ycombinator.com/item?id=14520230) have an implementation in assembly language (MIX/MMIX), with a pointer to an exercise that asks you to analyze how many times a certain register is modified or whatever. In TAOCP, we always have mathematics in the service of algorithms -- the idea is to take an actual algorithm/program that can be implemented, then analyze it using whatever mathematical tools it takes (many of which were invented by Knuth... in fact at one point he wanted to name the books "Analysis of Algorithms", but the publishers didn't think the title would sell).

* For a concrete example: just last week I read TAOCP's section on tries (Chapter 6 Searching (Vol 3), part 6.3 "Digital Searching"). In CLRS there's a passing mention of tries (radix trees) only in one paragraph (Problem 12-2 in Chapter 12 Binary Search Trees), which asks to prove that using this data structure a bunch of binary strings of total length n can be sorted in O(n) time. This makes sense I guess because mathematically/asymptotically there may not be much more to say about them. But they are an eminently useful data structure that are practical to implement, and can make programs fast (only by a "constant factor" but that's what a real programmer cares about). So TAOCP spends about two pages explaining tries (with a useful diagram) and in fact their implementation as a bunch of arrays (not as a tree), then gives a MIX program to make it even more concrete, then some concrete numbers and words about when they're appropriate, and some history, goes into more depth on the specialization to the binary case, proceeds to explain PATRICIA tries (another practical data structure). All this takes 9 pages. Then there are 7 pages of mathematical analysis (leading to conclusions like, for example, a trie search inspects an average of lg N + 1.33 bits for a successful search and lg N − 0.11 for an unsuccessful one). Then there are 6 pages of exercises giving further ideas, all of which have at least brief solutions at the back of the book (~8 pages). Any of these (the assembly program, the mathematical analysis) you can easily skip if you're not interested, and still get something something of value as a working programmer. (If you want to implement your own searches that is... if all you do is use libraries written by others for writing CRUD applications none of this may be relevant much but that's the same for CLRS too.)

Re:Ask HN: How do I choose the right resource to learn CS fu... by brudgers on Tuesday December 31, 2019 @10:59AM (#21921888)
I wouldn't argue against your experience. Or that people don't use Knuth much or at all in their work. Most people don't use textbooks much or at all in their work.

Per the question, the context of my answer is learning CS and in particular self-directed learning. If the question was about resources for work, I'd probably say "StackOverflow" and be done with it.

Re:Ask HN: How do I choose the right resource to learn CS fu... by panpanna on Tuesday December 31, 2019 @11:52AM (#21922418)
I would argue that Knuth is particularly bad for _learning_ CS.

(Based on my experience as CS undergrad and grad student later)

Re:Ask HN: How do I choose the right resource to learn CS fu... by brudgers on Tuesday December 31, 2019 @12:33PM (#21922745)
Knuth being impenetrable after six year or so years of formal study using other materials, doesn't seem like a strong case for those other materials. It smells more like six hours in the lab saving an hour in the library.
Re:Ask HN: How do I choose the right resource to learn CS fu... by wendyshu on Tuesday December 31, 2019 @10:40AM (#21921684)
TAoCP is a terrible resource for a beginner.
Re:Ask HN: How do I choose the right resource to learn CS fu... by patrec on Tuesday December 31, 2019 @11:02AM (#21921931)
Plus, Knuth, despite his accomplishments, is a terrible computer scientist and programmer in some capacities. TeX must be the most odious language not designed as a deliberate joke.
Re:Ask HN: How do I choose the right resource to learn CS fu... by svat on Tuesday December 31, 2019 @12:18PM (#21922630)
TeX is not a "language"; it's just a tool for typesetting when you want to go the last mile of achieving book-quality printing. The fact that it turns out to be possible to (ab)use its macros (originally designed merely to save the user some typing effort) to do "programming" shows only that it's easy for things to become "accidentally Turing complete" [1], and the cleverness/perversity of its user community.

> TeX was designed for typesetting, not for programming; so it is at best “weird” when considered as a programming language. — DEK, Digital Typography, page 235

> In some sense I put in many of TeX's programming features only after kicking and screaming. — DEK, Digital Typography, page 648

> So TeX is a programming language but I had to put in those features kicking and screaming. […] In a way I resent having every language be universal because they’ll be universal in a different way. […] I was really thinking of TeX as something that the more programming it had in it, the less it was doing its real mission of typesetting. When I put in the calculation of prime numbers into the TeX manual I was not thinking of this as the way to use TeX. I was thinking, “Oh, by the way, look at this: dogs can stand on their hind legs and TeX can calculate prime numbers.” — DEK, interviewed in Peter Seibel's Coders at Work

> Michael Plass, who was Don's student and worked with Don on TeX, told me once that "Don tried very hard not to make TeX a programming language. Unfortunately, he didn't succeed." — Norman Ramsey

I've written more about this verbosely elsewhere [2], but in any case even if TeX had been intentionally designed from the start for public consumption (rather than for just him and his secretary, as was his original intention), it hardly justifies something like "terrible computer scientist" — TeX/MF/CM was just his side-project; the computer science is different.

[1]: (Accidentally Turing-complete) https://www.gwern.net/Turing-complete http://beza1e1.tuxen.de/articles/accidentally_turing_complet... https://aphyr.com/posts/342-typing-the-technical-interview https://www.youtube.com/watch?v=uNjxe8ShM-8

[2]: https://tex.stackexchange.com/a/384881/48 , https://cstheory.stackexchange.com/a/40282/115

Re:Ask HN: How do I choose the right resource to learn CS fu... by frogger23123 on Tuesday December 31, 2019 @01:42PM (#21923305)
> + The foundation of computer science is Knuth's The Art of Computer Programming. Everything else is footnotes.

The foundation of computer science would be the work done by the likes of Alan Turing and Alonzo Church. They established foundations of CS before Knuth was born.