Ask HN: What language-agnostic programming books should I read?
927 pointsUntil now I've read:
- The Healthy Programmer
- Clean Code
- Test-Driven Development by Example
What should I add to my library?
Comments (337) 132 threads
* "Compilers: Principles, Techniques, & Tools" by Aho et al. (i.e., "the dragon book")
* "Data Flow Analysis: Theory and Practice" by Khedker et al.
* "Understanding MySQL Internals" by Sasha Pachev.
* "Transaction Processing: Concepts and Techniques" by Gray and Reuter.
* "Fundamentals of Wireless Communication" by Tse and Viswanath.
* "Genetic Programming: An Intrduction" by Banzhaf et al.
* "Applied Crytography" by Schneier.
EDIT: A few additional comments:
(1) Although these books are problem-domain specific, some of them had benefits outside of their problem domains:
* The Dataflow book has some great coverage of fixpoint algorithms. It's really helpful to recognize when some problems are best solved by fixpoint analysis.
* The "dragon book" takes a lot of the mystery out of compilers. That's somewhat helpful when writing code that needs to be fast. It's super helpful if you want to work with compiler-related technologies such as LLVM.
* Understanding the fundamental challenges of transaction processing helps you avoid massive misadventures when dealing with databases or concurrent / multithreaded systems.
(2) YMMV, but I've found it hard to soldier through these books unless I had a need to for my job or for school.
An equivalent substitution for another database would be fine; anyone have any suggestions? Then again, such a substitution is really solving a non-problem.
IMHO, MySQL is especially ugly due to an attempt to insert an abstract interface around its storage engines. IIRC that interface is leaky, and its documentation is pretty spotty. Also, the InnoDB storage engine has a lot of complexity that seemingly duplicates what's provided on the storage-engine-agnostic side of that interface.
One of the big lessons I took away from studying MySQL's internals, and partially confirmed by the "internals" book, was this: Be careful when designing a plugible storage-engines framework for a DBMS; MySQL has some examples of what can go wrong.
That's something you're unlikely to find mentioned in a generic DBMS-implementation book, but is very good to know about regardless.
Additionally, I don't see how the need to know about the internals of MySQL means one should use a better database. PostgreSQL is normally proposed as the better alternative to MySQL if one sticks to Open Source, and all the good experts at it I have met were familiar with its internals too.
Continue this thread — 1 reply
It's definitely a good idea to have prior general knowledge of database internals before reading an "internals" book.
I'm not sure if it's out of date, but my favorite book on the topic was "Database System Implementation" by Garcia-Molina et al. I found it to be super-readable.
What I like about the "internals" book is you get to see a real, specific database up close, warts and all. It gives you a different perspective from an overview book like the one mentioned above.
For a good intro of modern back end development, check out Engineering a Compiler. It's also got the lexical and parsing end of things, but a bit better done, but still quite theoretical.
One of the best books I read on programming is "Concepts, Techniques, and Models of Computer Programming"; it's not strictly speaking language agnostic, based as it is on Oz, but Oz isn't a language you'd ever use in production and is a reasonable base to introduce you to ways of programming that will probably be completely unfamiliar, like constraint programming, dataflow, concurrent logic, etc.
Continue this thread — 1 reply
Wrote many for XML/json based configs.
Most programmers don't understand parsing worth a crap, imho. Some compiler theory would do most of us some good. I read it because I was doing data stream parsing back in the olden days before XML (which was before JSON), when we had to write our own stream formats. It really changed my whole way of thinking about a fundamental class of programming problems.
Being familiar with the Chomsky Hierarchy ([1]), and the kinds of language recognizers required for each level in that hierarchy, can save parser authors a lot of wasted time.
E.g., "regex's can't count!"
[1] https://en.wikipedia.org/wiki/Chomsky_hierarchy
'Essentials of Programming Languages' and 'Types and Programming Languages' are good choices. (But slightly off-topic for this particular subthread, since they don't deal with parsing.)
Try "Parsing Techniques: A Practical Guide" and then a more concise book like Muchnick.
As someone who has quite a few books on compilers, program analysis, type theory, etc... I find the Dragon book an irreplaceable reference to this day. It has a breadth of content shared by very few other books. For instance, Muchnick's classic "Advanced Compiler Design and Implementation" is really good for analysis and optimization but neglects all front end topics. The only area where I believe the Dragon book is inadequate in is type theory (I recommend Types and Programming languages [TAPL] by Pierce and Semantics with Application by Nielson for a gentler intro).
As to parsing, its chapter on parsing (4) is not as "hip" has some people want. However, it is solid and will teach you how to do parsing. There are newer and fancier techniques not covered in Chapter 4 but in general most people would benefit just having a solid understanding of recursive descent parsing!
If you want more resources on Compilers other than books, such as tutorials, guides, talks and papers, then go ahead and check the Awesome Compilers vertical I compiled a while ago: https://github.com/aalhour/awesome-compilers
Cheers!
One of the more famous compiler writers from that era once told me that the Dragon book's original codegen section wasn't even historically how anyone wrote a compiler and it certainly didn't reflect modern practice even back in the 90s.
However, the update significantly improves it with the addition of Monica Lam's contribution. I don't know if it's state of the art for codegen (probably not), but I'm not sure what book is (Muchnick is great too, but this is also quite old now).
Applied Cryptography was an important political statement that we can and should have access to cryptographic technology, but I don't think it can be recommended as an appropriate introduction to the field in 2017.
Also, Donald Knuth's "The Art of Programming" (at least the fundamental and sorting/searching algorithms books), plus a book about graph theory and algorithms.
Continue this thread — 1 more reply
2004 is old now? Really?
Honestly, good books don't age as long as their core domain stays valid. Structurally C++ is pretty much the same as when the book came out.
It was written for a different type of developer and a different type of development environment and a specific language, C++.
You haven't looked at C++ lately if you think it's the same as it was in 2004. The ISO has released new versions of the language in 2011, 2014 and ratified a new standard here in 2017. If you're writing C++ code that is consistent with 2004 C++ then you're writing a really bad version of "C with classes", not C++.
Edit:
Modern C++ contains native support for the filesystem, threads, lambda expressions, variants, upcoming networking library, coroutines (at least in Visual Studio), no more new/delete memory management, parallel algorithms and a ton more. This is a completely different language now and the code you write looks nothing like 2004 C++ code.
Continue this thread — 9 replies
That statement alone, one of the sections of the book, recommending you to allow the compiler to find your errors for you, is an example of the "age" of the book.
At the time I read it, when it first came out, I loved it. I still love Michael's work and advice to this day, but this book was written for another time.
And also it seems to be something lots of programmers don't realize for some reason - many times I had to instruct people to crank up their compiler warning settings and actually read them. Especially in C-land, I can't count the number of times I solved someone's problem by appending -Wall to the gcc invocation and telling them to come back after they fixed all the warnings...
Continue this thread — 2 replies
And Fred Brookes' book is over 30 and sadly just as relevant.
Definitely the best book I've read on programming.
While it certainly espouses a functional style, I found the greatest lesssons to be higher level, focusing on abstraction.
Though I have limited knowledge of C and Java so would be keen to hear your elaborated thoughts on this.
Also, as a beginner, you don't want both the difficulties of contepts _and_ the difficulties of language to combine to stop you from learning as effectively.
Continue this thread — 4 replies
Continue this thread — 4 more replies
Continue this thread — 4 more replies
All comments shown.
Couldn't load more comments. Check your connection and try again.