Ask HN: I'm looking for a good book on the fundamentals of CS
I'm at the beginning of my software dev career, and as I didn't go to school for anything related (B.Sc. Chemistry), I feel like I really would like to have the fundamentals of CS down. Doubly so as I would like to go into the field of VR, and right now I'm working on my own toy rendering engine, which I feel is really exposing my lack of knowledge...
Anyways, any suggestions welcome. Ideally it'd be more digestible than just a plain textbook but I'm open to anything. I imagine either way it'll be a tough but great read to work through :)
189 comments
[ 3.0 ms ] story [ 219 ms ] threadBut it won’t help you land a job at a startup, for that you need to learn JavaScript or C++
Use videos for faster learning though. It’s pretty much learning on cruise mode.
With books I can also stop and take notes or reflect on what I've learned. That's harder with video.
And of course fewer words are spoken on video than are written in a book with fewer concepts and fewer illustrations, and with more verbal miscues -- errors or omissions.
I also rely heavily on the index of a book to look up related topics and terms, as used by the author.
In subjects that are precise (like math or algorithms) I've found learning from books to be far superior to video.
That said, some videos are great, especially those that animate or visualize, like 3Blue1Brown and Khan Academy.
I'm pretty sure I can read at twice the speed that an average video is spoken.
And more importantly I can pause to think, re-read a sentence I didn't grasp and pace myself. All of these are far more cumbersome to do with video.
There my be entirely valid reasons to prefer videos. But I strongly contest the claim that videos are faster.
I used it for one of my college CS classes. The book was written to be a semester class and MIT even has various offerings of their version of the course recorded and available on YouTube.
The book is online and available for free.
https://mitpress.mit.edu/sites/default/files/sicp/full-text/...
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 IPC programming in Unix, but didn't like them, so I also stayed away from TCP/IP Illustrated, but others have different opinions.
[1]: <https://www-cs-faculty.stanford.edu/~knuth/taocp.html>
[2]: <https://www.csapp.cs.cmu.edu/>
[3]: <https://www.pearson.com/us/higher-education/program/Comer-In...>
IronicaLly, I put off reading Seminumerical Algorothms for years because didnt understand it was numerical algorithms for computers without reals. The random number chapter alone is so awesome.
Check on Knuth's website to see if it's already been corrected. If not, you could get a prestigious Knuth reward cheque for finding an error.
This line is classic Knuth:
0: https://www-cs-faculty.stanford.edu/~knuth/news08.html> Knuth offers monetary awards to people who find and report a bug in TeX. The award per bug started at US$2.56 (one "hexadecimal dollar"[41]) and doubled every year until it was frozen at its current value of $327.68. ... Due to scammers finding scanned copies of his checks on the internet and using them to try to drain his bank account, Knuth no longer sends out real checks, but those who submit bug reports can get credit at The Bank of San Serriffe instead.
(https://en.wikipedia.org/wiki/TeX - this is about TeX, though most of it is generic over all his various cheque schemes: https://en.wikipedia.org/wiki/Knuth_reward_check)
When someone without a formal CS career is asking for a CS fundamentals book and you're dropping TAOCP I'm not sure if this is a humble brag or an attempt at trolling.
Not saying these are bad books, they're actually brilliant (even with a couple of errors in the exercises). But with my (teeny tiny very little) teaching background, it's probably at the bottom of the list of things to recommend to someone just starting to look at CS fundamentals. Skiena's book would probably be my first choice.
Rightly said.
I am quite sceptical of people claiming they have "Read" Knuth's TAOCP; Browsed? Yes but Read/Studied? Not easily convinced. But perhaps i am just being too prejudiced and cynical.
There are a lot of "CS Course Online" type suggestions posted on HN, which are great - but for those of us with full time jobs and lives it's just a non-starter to approach that quantity of material.
I'm also more of a hands on learner which is how I got to where I am - but at the same time I can appreciate and happily absorb a well written, thoughtful book... In other words, I only have time for high quality, and high information density.
My meta suggestion in answer to the author: Not to downplay the utility in general CS knowledge and fundamentals, but you already sound like you are driven and have a direction - I recommend you ride that wave and buy books or seek out material that's more specific and relevant to what you are doing right now. You will soak it up so easily when you have something right in front of you to apply it to or think about - it's an opportunity, you will work on different things throughout your working life and this opportunity may pass. Personally, I have found CS fundamentals work their way to the surface through research into these more domain specific things - although I still recognise I could have much better awareness if I tackled it head on as you are suggesting.
What we tend to think of as "basics" happen to be what the problems were 50 years ago in computer science. If you don't have machines, you study the theory. If you have a very simple machine, you study the solve time (big O notation type stuff, although with exponential growth that is becoming more, not less, important).
All this is to say if you want to study VR/AR, perhaps the most important aspect is the relationship between the view angle, and the object. You would need to know linear algebra, transforms, the effect on the viewpoint and so forth. Linear algebra is one version of "the basics".
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, which is mentioned in some other comments. It's more of an introduction to functional programming. From your description, I'm not sure you need an intro to programming. And functional programming in particular is not really on the critical path of knowledge you'll need to muck about in VR land. It's not irrelevant, but it's not the critical path. An algorithms course probably is indispensable for that endeavor, though.
By all means, read SICP if you'd like. It's a great resource. But if you're trying to get from "I can program" to "hardcore hacking on VR stuff", step 1 is probably a decent algorithms course taught in the imperative style.
https://mitpress.mit.edu/contributors/charles-e-leiserson
I'd go with Sedgewick, then get CLRS and Knuth for use as reference material.
https://www.youtube.com/watch?v=1QZDe28peZk&list=PLwwk4BHih4...
I can't vouch for it, as I haven't watched them.
https://www.amazon.com.au/Basic-Microprocessors-and-the-6800...
https://www.nand2tetris.org/
You might like the Princeton Algorithms Coursera course: https://www.coursera.org/learn/algorithms-part1
SICP is an amazing book, but I HIGHLY recommend you follow along with a lecture video as the textbook was designed to go along with lectures for electrical engineering computer science students. Brian Harvey's lectures are fantastic: https://www.youtube.com/watch?v=4leZ1Ca4f0g&list=PLhMnuBfGeC...
And maybe some math? All of this is kind of abstract to start out with. It might be useful to combine this with youtube videos on your project, because you may be discouraged with doing a lot of abstract work and not concrete work on your project.
Also, freecodecamp and youtube in general is an excellent resource if you're stuck on any particular part of CS. Freecodecamp has compiled a lot of the best videos across the internet on particular concepts and you can get a deep dive into a topic if you're ever stuck. Nowadays, if you're stuck, often viewing someone else's explanation can get you unstuck fairly quick.
https://people.eecs.berkeley.edu/~bh/ss-toc2.html
Also known as "The Wizard Book" or "SICP".
The full text is legally available online[1], but I found it worthwhile to buy a copy.
There are at least two really good sets of video lectures to go with it if you are so inclined. Personally I enjoyed the ones from Berkeley.
[1]: https://mitpress.mit.edu/sites/default/files/sicp/index.html
1. Learning how to prove things with math
2. "Baby compilers" machine code, building an assembler, building a simple MIPS compiler, regular expressions, parsing, etc
There's a lot of other topics but those two really set the foundation. All algorithms class and data structures are best understood with a mathematical intuition. Not to mention you want to go into VR, lin alg might help you.
YMMV. Lots of great programmers don't have a math background, but for me that helped.
The CLRS book is pretty standard (but mathy).
You'll learn things as you work too so don't discount patience.
That book can be found on the Teach Yourself Computer Science page. [2]
The TYCS page says this book is advanced... but they teach this content to 1st years at University of Waterloo.. so really it's just difficult beginner material.
[1]: https://courses.csail.mit.edu/6.042/spring17/mcs.pdf
[2]: https://teachyourselfcs.com/#math
It's funny, I like to say I program by intuition. Trying to go through algorithms now, many years after college, makes me realize some math shortcuts really help, and I no longer have an intuition for that.
There doesn't seem to be enough focus on teaching proof techniques, and skips straight to discrete math content.
Could be a decent beginner resource if combined with something that teaches proof techniques though.
EDIT: the MIT book also listed is actually good [1]
[0]: https://cims.nyu.edu/~regev/teaching/discrete_math_fall_2005...
[1]: https://courses.csail.mit.edu/6.042/spring17/mcs.pdf
"The website has been blocked as per order of Ministry of Electronics and Information Technology under IT Act, 2000."
https://imgur.com/a/NuRxjFl
Another nontraditional intro to computing worth mentioning is "Structure and Interpretation of Computer Programs" by Abelson and Sussman(s). It teaches programming concepts using the Lisp/Scheme language (seldom used any more), but does so brilliantly.
"Think Python: How to Think Like a Computer Scientist" by Downey might provide the right mix of computing concepts and programming practice.
If you do want a traditional intro to CS theory, two books that cover that topic well are: "Introduction to the Theory of Computation" by Sipser, and "Introduction to Automata Theory, Languages, and Computation" by Hopcroft, Motwani, and Ullman.
Three very good books that introduce algorithms are: "Introduction to Algorithms: A Creative Approach" by Manber, "The Algorithm Design Manual" by Skiena, and "Algorithms" by Sedgewick and Wayne.
Remember that CS theory doesn't age, so buying a used early edition of a textbook should serve your needs just as well as an new up-to-date edition.
For a second or third book, consider 'Algorithm Design Manual', Skiena. I find it more approachable than the MIT Intro to Algorithms.
Also, 'The C Programming Language' remains one of my favorites for a pragmatic approach to learning how to say things to a computer, a great balance to learning the theory. There's a reason 'Hello World' has become so widely known that it's a cliche. But there is plenty of great advice there no matter what language you're in.
This is the second edition:
https://ia802802.us.archive.org/15/items/The_C_Programming_L...
The Aho book also looks to have gone out of print.
http://infolab.stanford.edu/~ullman/focs.html
http://i.stanford.edu/~ullman/focs.html
* The little schemer
* The c programming language (k&r)
I taught myself algorithms with the Algorithm Design Manual by Skiena, and I strongly recommend it. The first half is an exposition on algorithms, and it is mercifully readable, fun, and short. The second half is a catalog of different algorithms. You don’t really read through it, but it is useful as a reference if you have a specific problem you’re trying to solve and you want a background on algorithms in that area.
I have a CS degree and I still really enjoyed reading through the 1st ed. of the first volume. I haven't looked at what was done with the material since then.
Also as a non-popular opinion in this current age, I recommend you to learn how to implement your algorithms in C, rather than an easier to grasp programming language. Even if you are probably not not going to program in C in your future career, understanding how memory management works will give you an edge later.
Also given C's loose style, you will also get some skills in organizing your code in a language that doesn't impose a lot of obvious constraints to the way you write your code. You will be able to build your own conventions, and evolve them once you get more skilled. Seeing what others are doing is also important.
Good luck!
PS: Don't fall into the macro trap, you will never get out. (inside joke).
Were you referring to [Computer Science: An Interdisciplinary Approach](https://www.pearson.com/us/higher-education/program/Sedgewic...)?
On a more personal / subjective PoV, IMHO its just a much better book than the majority of the others. Its not as basic as Grokking Algorithms nor as interview focused as Cracking the coding interview. I would suggest the latter if you just want to be good at programming interviews.
What's the main difference between sedgewick and the grok algo book?
Yes percolation was a tough first assignment.
Week two was linked lists and really straight forward.
Also I found Sedgwick's explanations too terse, I ended up on YouTube countless times watching other videos that helped me get what he was saying.
I think it's probably me though, it's a Princeton course so I guess it's aimed at the very bright!
Completing those courses was probably the most useful thing I did when prepping for interviews as part of a career change 6 years ago.
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.
The one major difference (it is a tendency, not absolute) between software devs who came from CS and those that changed careers into it is a deep passion for computers and how they work. Look at HN, there's a lot of talk about Lisp, Assembly, C etc. although few people actually need it for their jobs. Dealing with these things usually comes from a place of passion more than a place of necessity, and they do make you a better dev, too.
A book I can warmly recommend if you want to see how deep your own interests go is "Principles of Programming languages" by MacLennan. He takes a historical approach, explaining the design principles of programming languages by looking at historically game-changing programming languages that few people still use today. The exercises get progressively more complex, and the last exercise is to design and implement your own programming language, a task I haven't yet done myself.
https://www.cs.princeton.edu/~rs/
I'd rather have the exercises / examples in C but not if it means swimming upstream.
From what I can tell he's collapsed it down to just a java version entitled "Algorithms" that hit 4th edition in 2011.
I never got around to picking that one up, so I don't really know anything about it.
It will take you on a journey from a lightbulb to assembly language. It’s extremely well written and I wish there were more books like it.
Although I recommend starting from "Code: The Hidden Language of Computer Hardware and Software". Coolest book ever.