Live data from Hacker News

Ask HN: I'm looking for a good book on the fundamentals of CS

news.ycombinator.com

121–130 of 190 posts

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#121
post #10

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…

Hm - I've read all three books and even tried working the exercises... I can't say I'd recommend TAOCP to somebody who's looking for a book on the fundamentals of CS. The books are fascinating, don't get me wrong, and I recommend every programmer read them, but they go way too deep into minutiae, while simultaneously ignoring other important topics to be useful as an introduction.

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#122
Lots of good stuff in this thread already, so I'll just add a thought or two. A lot of commentators here have picked up that what you need is roughly the equivalent of a "Data Structures & Algorithms" course. I agree with that sentiment. Whether you actually take a course, or work through some books, or whatever, so long as you acquire that knowledge you'll have a great foundation.

The 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

[1]: https://en.wikipedia.org/wiki/F._Thomson_Leighton

[2]: https://people.csail.mit.edu/meyer/mcs.pdf

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#123
post #64

I 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…

First, I want to support any mention of any Gerald Weinberg book. Every one is gold. IMO, Intro to GST is great for developing a scientific mindset, something broader than computer science itself.

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

#124
post #97

Earlier 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!

No probs, best of luck!

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

#125
The Manning book is a great, very approachable and even enjoyable intro to the basics of algorithms and data structures. It’s got illustrations and everything!

It 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.

https://www.manning.com/books/grokking-algorithms

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#126

Based 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)…

i recall finding some published solutions manual to the book 7-8 years ago when in college

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#127
Hey! I have written a book on conceptual foundations of programming and CS. It is language-agnostic and focuses on principles that transcend programming languages. It talks about everything from functions and types (and where they come from, theoretically) to concurrency and parallelism. It's written with beginners in mind that want to have a grasp on concepts as well as working devs that have hands-on experience with a language, but want to learn to think in cross-language concepts. I am really short on time to put a website on the internet yet (I hope by Christmas it'd be up), but I'd love to send a draft to whoever is interested (if you like, you can pay me later, but no obligations) Email is blagovest dot gospodinov at yah00 dot c0m (just say you're from HN)

edit: 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

#128

Earlier 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.

I came from math as well! For what it’s worth, I’ve found that even the brightest computer scientists and software engineers have a solemn respect for mathematics.

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

#129
post #25

I haven't used it myself but have heard good things about the resources here - https://teachyourselfcs.com

This website is blocked in India with the message.

"The website has been blocked as per order of Ministry of Electronics and Information Technology under IT Act, 2000."

https://imgur.com/a/NuRxjFl

Re: Ask HN: I'm looking for a good book on the fundamentals of CS

#130
I'd advise SICP. Even though it is focused on functional style, it really does apply to general programming.

It 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.

Post reply on HN