Ask HN: What's the best computer science book you've read recently?

670 points by bobnarizes ↗ HN

200 comments

[ 2.2 ms ] story [ 250 ms ] thread
Not new, but "Hacking - The Art of Exploitation".
This is a great book for introducing infosec!
Hah yes, I have it in a box somewhere. Great detailed book, highly recommend.
A New Science - Wolfram

Maybe stretching outside the typical, but I have a weakness for cellular automata.

Also, I've vowed never to buy another Oriely book or similar book ever. Online docs are free and stay up to date.

The book is basically a scam and panned. He talks about automata like it was new and he invented it. I strongly suggest you read the Amazon reviews.
On the plus side it is full of pretty pictures, has a massive number of pages which can be used to press leaves or flowers, heat in the winter and a door stop in the summer to encourage airflow. There really isn't a bad quality about this book. Oh, and super cheap on the used market.
Got mine for about 10 USD. page/price ratio is quite impressive.
I can form my own opinion thanks.

At least he doesn't have his head up his ass the may Mandelbrot did.

And on top of it all he generated a great deal of original work.

> At least he doesn't have his head up his ass the may Mandelbrot did

I see you've never met Stephen.

Wolfram is known to be super arrogant. Granted, he has accomplished a lot as a business man and is probably almost twice as intelligent as me, but there are probably more useful books out there.
This one is a waste of time. Nothing new expanded to (what feels like) thousands of pages.
I read the whole book 15 years ago. It was a waste of time and money.

The only new thing I found was a Turing Machine with (iirc) 1 less tape - the whole book could have been reduced to a 4 page paper, as far as new work is concerned.

Has anyone read "The Impostor Handbook"[0]? What do you think of it?

[0] https://bigmachine.io/products/the-imposters-handbook/

Edit: I'm not connected to the book.

I think it's well intentioned and the author seems like someone who has put a lot of work into something they think is important, but it contains some terrible technical misunderstandings, and that's a real shame as I cringe thinking about a developer without a CS degree who's read this book to make themselves more confident in interviews repeating some of the stuff in it.

https://github.com/imposters-handbook/feedback/issues/50

"Structure and interpretation of computer programs"

Definitely recommended.

I finished it up a few months ago and I cannot recommend it enough.

The real soul of SICP is in it's exercises however. It asks you to build on your own prior work in inventive ways, challenging you to solve the exercises correctly, but also to do so in a maintainable way.

I wrote up some supplementary material to make the experience smoother for a practicing programmer: High-level requirements of the chapter subprojects, Pitfalls and paradigms embedded in some of the footnotes, Answers to (nearly) all exercises, a testing framework for Chapter 4 interpreter (including the JIT compiler), a GUI for running Chapter 5 virtual machine here: https://github.com/zv/SICP-guile

The one thing I really wish I had was a comprehensive test suite for all the exercises. They are (obviously) hard to solve and there's no other way to see if you were right but to check the solution. It's a huge flaw in most CS books, feedback without hand feeding you the answers.
I disagree with this pretty strongly, actually. The best skill you can get from SICP-level exercises is looking at the code and being completely confident that you understand it and that it is correct. The best way to use them is to write the code without running it, and once you are sure, review it with someone else to find out if you were right.

This breaks down a bit around chapters four and five where you are plugging in parts of a larger code base, and the accidental complexity starts to dominate.

Reviewing with someone else can be a challenge for self-study; that's the step a test suite would replace.

Of course someone could use the test suite to just make changes semi-randomly until it works, but there's no reason it has to be used that way.

Self-study students can find someone online to study together.

I like the amount of projects SICP inspires. That's one of the best things about it. I wouldn't want to discourage writing a test suite, but I wouldn't suggest studying it by using one.

SICP questions are designed to have elegant solutions, which may be missed, this is one reason why a study group is better than a test suite.

The Master Algorithm by Pedro Domingos
I still haven't read anything better than Code by Charles Petzold [1] and it's not even close.

[1] https://www.amazon.com/Code-Language-Computer-Hardware-Softw...

It is a fantastic book. It doesn't take u into typical algorithms (at least that I recall), but rather it explains as intuitively as possible how a computer is built up from flip flops and binary logic to assembly, intermediate language and on to full-on compilation of a useable language.

Basically beginner programmers can acquire a broad understanding of the foundation the programs you're building are built on by reading this book. It reads more like a non-fiction expose than a programming language tutorial book, which is to say, given its subject, it's an easy read you can do on the couch. Depending on your skill and knowledge level, there may be a few sections you have to re-read several times until you understand it, but you won't feel as though you need to go over to your computer chair and try something to fully grasp it.

If you can do basic arithmetic, you can get through this book. That seems to be the hidden premise. That computers are easy and should be easy to understand. This book is a testament of that. Though I'm sure some will find this doesn't go deep enough. But the point is: learning so generally will create many entry points for you to follow up on in your journey into programming and computer science. It will clear up many things and essentially make the path seem less scary and out of reach. This book achieves that really well. High level programmers will come away feeling far less insecure about their lack of knowledge of the underpinnings of whatever it is they are developing. I know I did. I can't say enough about this book. It's the real deal. I'm sure those with a computer science degree might have more to say (that is they likely think it's a cursory overview), but I think for everyone else it's a computer science degree in a book you can read in one or two weeks. At least half the degree. For the second half, I recommend Algorithms In A Nutshell. And done! Go back to programming your high level JavaScript react app and get on with your life.

On a side note: it's my opinion that theory first is the wrong way. Application first, theory as needed is the right approach. Otherwise it's like learning music theory before u know u even like to play music. U might not even like being a programmer or be natural at it. And if u spend 4 years studying theory first, u will have spent a lot of time to discover what u could have in like a month. In addition, it can suck the joy and fun out of the exploration of programming and computer science. It's natural and fun to learn as u dive into real problems. Everything u can learn is on the internet. It's very rewarding and often faster to learn things when you are learning it to attain a specific goal. The theory u do learn seems to make much more sense in the face of some goal you are trying to apply it to. In short over ur computing career u can learn the same stuff far faster and far more enjoyably if you do so paired with actual problems.

But that said sometimes u do gotta step back and allocate time for fundamentals, even if u have no specific problem they are related to. However you will know when it's time to brush up on algorithms, or finally learn how the computer works below your day to day level of abstraction. Just know that a larger and larger percentage of us programmers went the applied route, rather than the computer science theory first + formal education route. It's probably the majority of programmers at this point in time. In short u r not alone learning this as u go. Learn to enjoy that early on and save yourself from the pain of insecurity of not knowing everything. This is an exploration and investigation, and perhaps you will make some discoveries nobody else has been able to make, and far before u have mastered and understood everything there is to know about he computer. Perhaps that's it's biggest selling point--you don't have to know everything before you can contribute to the computer world! So enjoy your pursuits in program...

Is this book relevant only to beginners? Do you think a programmer with about 7 years of experience (in C, C++, C#, Java) will find it useful?
Yes! I read it about 5 years after finishing my degree (which already covered many of the topics in depth), and it was very enjoyable. It gives a very good, succinct (if simplified) overview of computer architecture.
Absolutely, the book sits nicely between being fairly general but goes into just enough depth without bewildering you.
It's a really short and interesting read. It's difficult to think anyone could read it and find it to be a waste of time.
I don't think theory first is wrong by itself.

I think that everyone will get new information better when it is something that fixes an immediate issue or clarifies an immediate doubt.

But this is not a contradiction. Theory can be presented in such a way that you want and need to know the next piece of information, the way mystery novels work.

It can be easier for the writer to create this need with examples instead of narrative, no doubt about it.

But let's not fall in the opposite direction of having only examples and no theory, so common with blogs now. I feel empty when I read such materials.

Thank you for your inspiring words!
(comment deleted)
(comment deleted)
Engineering a Compiler 2nd Ed by Cooper & Torczon

I used it to supplement my prescribed compiler construction textbook and it's incredibly useful! Also surprisingly easy to read compared to some texts with a very math-heavy approach.

Fun fact: these two are married and the cutest couple. They walk to Rice's Coffeehouse almost daily together talking about whatever it is compiler professors talk about.
This book was my greatest buy ever! I once went to Fry's electronics to their book section - my expectation was to find only popular books there, when lo and behold, I see this book on compilers. I turn it over to look at the price tag, thinking I'll have to shell out something like $80 for the book and to my shock and surprise the tag says,... wait for it... $0.01 That's right one cent! At first I think this is some kind of prank and somebody peeled off a price sticker from some discounted stale candy or something and stuck it on this book. I'm of half a mind to see if I can buy slip this book by the store checker and have them just scan the one cent price tag and not to a double take. But my concsience gets the better of me and I walk up to a store clerk point out the one cent price tag and ask them to do a real price check so I can find out the fair price. The clerk looks up the book in his computer and says, nope that is the correct price in their system! So I bought "Engineering a Compiler 2nd Ed. By Cooper & Torczon" for $0.01! My greatest book buy ever!
Wow, that's awesome! I picked up mine second hand at a textbook distributor for the equivalent of about $30.

For anyone interested in other books on compiler construction, I would recommend these:

- "The Basics of Compiler Design" by Torben Mogensen

- "Modern Compiler Implementation in C" by Andrew Appel (ML and Java versions available too)

- "Modern Compiler Design" by Grune, Bal et al.

The Dragon Book is obviously infamous for this topic, but I would recommend covering at least two slightly more basic texts before taking it on.

Try Principles of Program Analysis by Nielson & Nielson. Uber hardcore and beautiful approaches to static analysis and optimization, on a very general mathematical framework.
The Algorithm Design Manual by Skiena.

Each section contains a story of some situation he was in where he faced a problem which he solved by applying one of various algo techniques (DP, divide and conquer, etc.). After reading CLRS for a class, it was nice to see how some of the most common textbook algorithms have been applied by a notable computer scientist.

This is a great book. I love the approach, it really helps with one of the main problems with using algorithms or design patterns even and that is problem identification. There are a bunch of problems that are way easier to solve if you recognize the solution exists in dynamic programming for example, but if you don't they become very hard.
The book definitely reaches a good balance that other algorithms books don't have. It makes you want to keep reading.
(comment deleted)
Such a nice book. My personal preference is to use CLRS for reference and Skiena for people want a quick introduction to algorithms.
It's kinda hilarious in that. CLRS is the gold standard recommended introductory text for algorithms, but it's so dense and over-stuffed that it's overkill, so better for reference. Skiena has a lot of stuff you don't need, but is comparably more succinct and light to read.
prepping for google interview?
Google's moto is Data Beats Algorithm. Don't forget that :)
I love this book for how approachable, readable, and even enjoyable it is. Skiena does a great job of motivating each of the algorithmic techniques. I recommend this one widely.
This book is highly overrated. Algorithms by Sedgewick (http://algs4.cs.princeton.edu/home/) is a much better book for learning and understanding algorithms. Skienas book is a simple collection of (sometimes very exotic) algorithms. It won't teach you anything, it will only tell you what exists.
> Skienas book is a simple collection of (sometimes very exotic) algorithms

It has the same material as Sedgewick, doesn't it?

No, I believe there are more algorithms listed in Skienas book. But from Skienas book you will barely understand them and it won't teach you how to really implement them. Sedgewicks book is much better in that respect. One can compile and run the given Java examples and actually play around with them. Skienas book is a good reference for postdocs in algorithmic design. Sedgewicks book on the other hand is for people who actually want to implement these algorithms.
I'm glad to hear someone else say that because the book seems to get high marks and recommendations but I didn't care for it at all. I thought it was just me. I just don't think he has a very engaging writing style.

The second half of the book is "the catalog" of algorithms and I guess maybe that's what people like but the I had so few "a ha" moments reading the book that I got to page 130 before I threw i the towel.

Grokking algorithms. Great book, especially for someone like me who doesn't deal too much with this stuff (as an embedded systems engineer).

Grokking functional programming and deep learning seem awesome as well, but I haven't finished either so take my recommendation with a pinch of salt.

Quantum Computing for Computer Scientists

Note, you have to be willing to put the time in, especially if your linear algebra is rusty or (like me) you have only a passing familiarity with complex numbers.

With that in mind, it's almost entirely self-contained and you can immediately start to make connections with classical computing if you're familiar with automata.

I've been interested in learning about quantum computing for a few years now and this book finally got me going.

https://www.amazon.com/Quantum-Computing-Computer-Scientists...

[update]

As an aside it's a really great excuse to try out one of the many computer algebra systems out there. I gave Mathematica a trial for fun since I'd already used SageMath in the past.

Leonard Susskind's "Quantum Mechanics: The Theoretical Minimum" as well as Nielsen & Chuang's "Quantum Computation and Quantum Information" are also fantastic resources. I've got both sitting here on my desk :)
Lately I've been reading Network Algorithmics. Awesome book.

https://www.amazon.com/Network-Algorithmics-Interdisciplinar...

This book blew my head off when it first came out (I used to work in the space). Highly recommend.
Indeed! This book is likely to be 100x more interesting than your local college's undergrad networks course.

The dozen or so principles Varghese lays out for writing fast networking code is reason enough to pick it up. The writing is very approachable, too. Reminds me more of the early network operator books than a CS text.

Wow this is a unique book! Just skimming I see Bloom filters, tries, routing protocols, sequential logic and DDOS all in same book. This looks great. Thanks for sharing.
More about programming than computer science, but it does talk a lot about and show some custom algorithms (it's more about programming-in-the-small, though it does talk about some big picture too), also it is old and out of print (last I checked), but I thought it was really good when I bought and read it, so mentioning it:

Writing Efficient Programs

Also has a great bunch of "war stories" about performance tuning in real-life, including one in which people, IIRC, improve the performance of quicksort on a supercomputer by 1 million times or some such, by working on tuning as well as architecture and algorithms at several levels of the stack, from the hardware on upwards.

by:

https://en.wikipedia.org/wiki/Jon_Bentley_(computer_scientis...

Edited to change Wikipedia URL to more specific one.

Despite its age, I think it is still very worthwhile, just like Programming Pearls.
Yes, and the same goes for More Programming Pearls - all 3 by Bentley (for those who don't know).
When I started coding for a living in the early 1990s (in an environment where efficiency was paramount), Writing Efficient Programs was gold. I still have it, and I'm glad that to see that it's still valued.
> (in an environment where efficiency was paramount), Writing Efficient Programs was gold. I still have it, and I'm glad that to see that it's still valued.

Interesting to know, and agreed.

The book even has a list of thumb rules for the various kinds of optimizations it describes, with guidelines on when each one is appropriate to use or not (as you would know, having read it). Great writing throughout, too. Loop unrolling (for both fixed- and variable-length loops) was one among the many cool ones.

Like others in this thread, this is more (only, in fact) about programming but I found The Go Programming Language to be an absolutely perfect introduction to Go with fantastic examples and succinct prose. It's beautifully typeset as well, which doesn't hurt.

http://www.gopl.io ISBN: 978-0134190440

I've been planning to get into GO this spring, would this be a good start? Or is there a possibility that it goes out of date?
A Science of Operations by Mark Priestley (http://www.springer.com/gb/book/9781848825543)

This is cheating a bit, because the book is history of computer science rather than computer science, but I think anyone interested in programming should read it. We often think about history of computing (and what it teaches us) in a retrospective way (we see all the amazing totally revolutionary things that happened), but it turns out that if you look deeper, there is often a lot more continuity behind key ideas (and we just think it was a revolution, because we only know a little about the actual history). This book goes into detail for a number of major developments in (early) programming and it makes you think about possible alternatives. It was one of the books that inspired me to write this essay: http://tomasp.net/blog/2016/thinking-unthinkable/

Along these lines, "A Life out of Sequence: A Data Driven History of Bioinformatics" (http://press.uchicago.edu/ucp/books/book/chicago/L/bo1674439...)

If you you work in bioinformatics it is weird how little history the average bioinformatician knows (the field only really dates back to the late 1960s). People may know things like PAM matrices, but not Margaret Dayhoff who created them (not to mention the standard amino acid codes used today).

(comment deleted)
(comment deleted)
GEB
It's a fun read. 30+ years since I last read it, I'll have to bump it up on The Pile :-)
Reading GEB always makes me feel like such a philistine.
haha, I'm reading it now - finally after many years - and I can absolutely relate to the feeling you describe. I decided that I won't be hard on myself for not understanding it all at the first read. Still quite enjoying it so far (1/3rd read). Additionally I also decided that I don't have to finish it unless I feel like ( specially considering it's 800pages).
You just read and re-read it over and over and still find something interesting
(comment deleted)
(comment deleted)