I'm currently going through TAOCP [1]. So far, seems pretty good (although I found one mistake in an exercise). Also, I can never recommend Computer Systems: A Programmer's Perspective [1] enough. (Also features a rare mistakes in an exercise or two, but that's detail.) And for network protocols, Comer's Internetworking with TCP/IP [3] was just great (you only need volume 1). I've read Stevens' books on socket and IP…
Ask HN: I'm looking for a good book on the fundamentals of CS
121–130 of 190 posts
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#122The question then is "what next?" To which I would say that you want roughly the equivalent of a course titled something like "Introduction to Computation" or "Automata Theory & Computation" or whatever. That is, you'll want to understand things like Universal Turing Machines, Finite-State Automata, Formal Grammars, and some basics of Computational Complexity Theory (the same "Big O" stuff you'll hear mentioned in the Data Structures & Algorithms class, but going a little bit deeper). This stuff isn't necessarily required to do a lot of "grunt work" programming, but it starts coming into play if you want to do some more advanced stuff.
One of the classic texts in this area is by Hopcroft & Ullman.
https://www.amazon.com/Introduction-Automata-Theory-Language...
And on a semi-related note, there's a really good course on Youtube: MIT 6.042J Mathematics for Computer Science, taught by Tom Leighton[1], that you might find useful as well. A version of the book[2] used in that course is freely available online as well
https://www.youtube.com/playlist?list=PLB7540DEDD482705B
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#123I highly recommend "An Introduction to General Systems Thinking, by Gerald Weinberg. An orthogonal piece of advice that I got from a different book of Gerald Weinbergs' is to learn 3 or 4 Very Different languages simultaneously, to grasp the enormous difference between them all. In 2021 I'd recommend C (lowest level other than assembler: 1st caveat, I haven't looked at Rust) and then at least one Lisp-family language…
I would suggest a grain of salt to go with the three-four languages at a time recommendation. I'd have to dig up a stored book to find the reference, but Weinberg typically suggests learning two different languages, at least at the beginning. He advocates for the benefits of recognizing it's possible to say the same thing in different ways. My knee-jerk reaction, knowing him, is that he picked two rather than three or four to make things manageable for people getting started. If programming becomes a hobby, vocation, and/or avocation you'll likely wind up learning most of those languages eventually.
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#124Earlier quoted context omitted.
I've done a moderate amount of compiler work, and the resources I'd recommend are: - "Compilers: Principles, Techniques, and Tools" (v popular, generally referred to as the 'dragon book' on account of its cover): http://ce.sharif.edu/courses/94-95/1/ce414-2/resources/root/... - "Parsing Techniques": https://staff.polito.it/silvano.rivoira/LingTrad/ParsingTech... - Not quite about compilers, but the website 'Crafting…
Wow thank you very much!
If I have any advice, it's:
- Don't try to write a scannerless parser. It's a fool's errand. Lex first into tokens (e.g. LEFT_PAREN, KEYWORD(for), STRING_LITERAL("foo"), NUM_LITERAL(7), etc), then parse that.
- By the same, uh, token: keep everything modular and loosely coupled. Don't mix up parsing state into your lexer (unless you're lexing C or Python, famously), don't mix up lexing code into your interpreter, etc.
- For parsing, start with a simpler grammar. Parsing mathematical expressions is a classic example. Avoid complex grammars that require lots of backtracking or lookaheads. If you want a real language, Go is a good example - a large part of its famous compilation speed is due to its simplicity (due to the fact that its authors are old men who live in a counterfactual version of the 90s imagined in the 70s).
- YMMV, but I find the best approach to parsing is a packrat-inspired bottom-up parser. Iterate over the tokens, and for each token filter your list of rules ('productions') to those which match. 'Reduce' the simpler expressions as you go, and build the more complex expressions out of them (e.g. functions will typically have several statements/expressions, expressions several operations, etc).
- For the compilation step, unless you specifically want to learn about writing object code, then target a 'backend' IR like GCC or LLVM. You'll benefit from their optimisations, and the vast number of platforms they support.
- Choose a language you're familiar with - ideally a simple one - to write it in. You don't want to be learning a new language as you're doing this, trust me.
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#125It doesn’t go into loads of detail but as a first intro I think it’s great, then you can go deeper if you want.
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#126Based on the description you give, you probably want a Data Structures/Algorithms intro. The canonical Algorithms textbook is Introduction to Algorithms by Cormen et al. The MIT OpenCourseware course on Algorithms -- which includes videos and assignments -- follows along with that book: https://ocw.mit.edu/courses/electrical-engineering-and-compu... Note: In your case, I'll recommend against SICP as a first resource,…
So my problem with CLRS is that a lot of the content is in the exercises. There are places in the text where it says, "refer back to solution to problem 34", etc. The problem is, there are no answers to exercises to be found - and the exercises are so open-ended there's no way to check to see if you actually got the right answer or not. IMHO, CLRS (or any educational text that doesn't make exercise answers available)…
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#127edit: pasting chapter of contents from a python script i use:
"Foreword.md": dict(finished=False),
"Function.md": dict(finished=False),
"Data and Types.md": dict(finished=False),
"Functions as Data.md": dict(finished=False),
"Function Types.md": dict(finished=False),
"Type Classes.md": dict(finished=False),
"Polymorphism and Types I.md": dict(finished=False),
"Polymorphism and Types II.md": dict(finished=False),
"Types as Data.md": dict(finished=False),
"Polymorphism and Types III.md": dict(finished=False),
"Universal Types.md": dict(finished=False),
"From Idea to Execution.md": dict(finished=False),
"Side Effects and Purity.md": dict(finished=False),
"Side Effects and Types.md": dict(finished=False),
"Objects I.md": dict(finished=False),
"Objects II.md": dict(finished=False),
"Objects III.md": dict(finished=False),
"Objects IV.md": dict(finished=False),
"Objects V.md": dict(finished=False),
"Objects VI.md": dict(finished=False),
"Names.md": dict(finished=False),
"Change I.md": dict(finished=False),
"Change II.md": dict(finished=False),
"Modes of Computation.md": dict(finished=False),
"The Infinite.md": dict(finished=False),
"Incomplete Functions.md": dict(finished=False),
"Syntax and Semantics.md": dict(finished=False),
"Memory I.md": dict(finished=False),
"Memory II.md": dict(finished=False),
"Parallel Computation.md": dict(finished=False),Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#128Earlier quoted context omitted.
I’ll sort of second this by saying that Sedgewick’s Algorithms I/II courses on Coursera are top-notch and completely free. He is a truly thoughtful educator. Completing those courses was probably the most useful thing I did when prepping for interviews as part of a career change 6 years ago.
Awesome!! Any other tips you have for someone going through that career change as well? I have a Mathematics BA, and worked as an actuary. I've self taught myself varying degrees of SQL, Python, JavaScript, and C, but I've found it difficult not to feel like an imposter without formal qualifications, even though I know I'm a capable learner and love solving challenging problems.
Don’t worry about formal qualifications. This is an industry where the largest and most successful companies were started by college dropouts. It’s still very young and things are changing faster than academia can keep up. A willingness to learn and relearn is critical.
My prep for big tech interviews basically boiled down to those algorithms classes, doing ~150 leetcode problems, slapping together a small junky android app, and perusing undergrad CS material on Wikipedia. To be honest, the first two are probably enough to get your foot in the door at the biggest companies.
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#129I haven't used it myself but have heard good things about the resources here - https://teachyourselfcs.com
"The website has been blocked as per order of Ministry of Electronics and Information Technology under IT Act, 2000."
Re: Ask HN: I'm looking for a good book on the fundamentals of CS
#130It made me a far far better engineer when I was first starting out.
There are lectures online for the book if you want to break up the tedium of just reading it.