There are so many programming books out there, but most focus on specific technologies and their half-life is incredibly short. Others focus on process or culture. Very few focus on the timeless principles of writing good code, period. The following five books had the biggest influence on my programming style and development:
- Smalltalk Best Practice Patterns: Incredibly practical advice for what constitutes good OO code. It’s done in Smalltalk, but the principles are mostly universal. Probably my favorite nuts’n’bolts of programming design book. Very granular.
- Refactoring: The fundamental before/after book. Here’s some code that could be better, here’s how to make it better. The trick to reading this book is to carefully read through every single refactoring pattern and then try to apply it on your code base (you don’t have to commit if it doesn’t fix things). You can’t just blow through it or you won’t really learn it. And you can’t just say “oh, I’ll look up a refactoring when I need it” — because then you don’t know what to look for.
- Patterns of Enterprise Application Architecture: Great inventory of many of the patterns that underpin Rails itself, as well as descriptions of many of the “new” approaches that people advocate today (like transaction scripts and service layers). You won’t necessarily implement most of these patterns yourself, but it’s an invaluable resource to understanding the differences in architectures and why framework work the way they do. (Funny anecdote: before I created Rails, I redrew many of the diagrams in OmniGraffle for Martin Fowler because I liked the book so much.)
- Domain-Driven Design: This is probably the least readable book of the bunch. It’s a slug to work through, but the ideas are worth it. It’s a great primer on how to turn a problem space into a beautiful OO domain model. What should your models be called? What logic goes where? How do we reproduce reality into an object model.
- Are Your Lights On?: This isn’t technically a programming book, but it deals with the biggest problem facing developers none the less: What is the problem we’re trying to solve? Is it the right problem? Could we solve a different problem instead and that would be just as good? Nothing has increased my programming productivity more than being able to restate hard problems as simple ones.
If you consider programming to be a subset of writing, and I certainly do, then you would also do well to read Elements of Style and On Writing Well. I’ve found reading those made me a better programmer as well.
Reading these five to seven books will give your programming chops more vitamins and nutritional value than a couple of year’s worth of blog posts and tutorial.
Bob Stanke
on 26 Dec 12If you ask me, it doesn’t get any better than “The Mythical Man-Month” by Fred Brooks. I had to read it for one of my programming classes back in 1999 when I was an MIS major at UW-Eau Claire. It is an old school book, but the lessons are timeless! If you ask me, it should still be a must-read for programmers of all levels.
Bob Stanke http://bobstanke.com
Nick
on 26 Dec 12I’d also like to put a few suggestions out for two books that have tended to outlast technology changes and continue to deal out great advice:
The Mythical Man-Month, a great story and history lesson rife with content that still applies even though technology has changed vastly.
The Pragmatic Programmer, nothing else has reinforced and changed how I work on a daily basis more than this book.
Daniel
on 26 Dec 12I’m surprised that Code Complete is not one of the five.
DHH
on 26 Dec 12Bob, Nick, those are good books too, but they’re aren’t really about the act of programming. They’re mostly about process, culture, personal development. This list is more for the nuts’n’bolts.
Daniel, I do like Code Complete, but it’s just not on the same level as these in my opinion. Too much of the content feels dated. But if you were to keep reading, it’s certainly by no means a bad book.
PhpGuy
on 26 Dec 12Yeah, sure you love my name, but I’m a huge fan of your company :-) Ill tell you what struck me as awesome about this post . Is that base camp is 10,000 lines of code. Remarkably small, and has made you millions. Good ideas, dont have to be big, they just work.
Hayden
on 26 Dec 12SICP?!?
DHH
on 26 Dec 12Also, I specifically didn’t put the Gang of Four book on there. I found it to be one of the most unreadable “supposedly great” programming books out there.
Ryan
on 26 Dec 12Domain-Driven Design was huge for me. A lot of my ideas for managing product dev came from there.
Zack Grossbart
on 26 Dec 12It isn’t a programming book, but I’d have to mention Computer Networks by Andrew S. Tanenbaum. The majority of programming I do is networked programming and understanding what’s going on at the low levels has been invaluable.
I also have to throw in Elements of Typographic Style to anyone who writes anything anywhere. All the designers know about this one, but most of the programmers don’t.
John
on 26 Dec 12Keep spittin’ the wisdom David! I want to add another one of Fowler’s gems albeit a lesser known one: Analysis Patterns. This is the first book where I personally saw domain models take shape in a meaningful way (specifically his patterns for accounting and also his patterns for recurring events in calendars which he published in a separate paper for OOPSLA). It’s sort of a precursor to Domain Driven Design IMO.
John
on 26 Dec 12and yes i know DDD was not written by fowler
Austin Schneider
on 26 Dec 12DHH: What are your thoughts on Practical Object-Oriented Design in Ruby?
Joe
on 26 Dec 12I owe my daily professional happiness to the happenstance of having picked up a copy of “Pickaxe” some seven years ago.
Ryan K.
on 26 Dec 12I’ve read 2 of those (Refactoring and DDD) – which were definitely very influential. I’m going to checking out the others. Thanks.
Some other lesser known books that some of my programmer friends and I have found helpful: Quality is Free, Conceptual Blockbusting, Peer Reviews in Software, Standing up to Experts and Authorities, and Coders at Work.
Eli Sarver
on 26 Dec 12I found a book that distills the book “Domain Driven Design”. It is called Domain Driven Design Quickly.
Faruk
on 27 Dec 12Can we find kindle ready versions of this books ?
Josué
on 27 Dec 12Test Driven Development by Example (Kent Beck) Agile Software Development, Principles, Patterns, and Practices (Robert C. Martin) Growing Object-Oriented Software Guided by Tests (Steve Freeman and Nat Price)
I think the TDD practice was a revolution higher than OO, for example. Só in my list there has to have at least one book about TDD. And in my list above has two. :)
Planning Extreme Programming (Kent Beck and Martin Fowler). But this one I think is not in the criteria you used.
Brett Hardin
on 27 Dec 12The books about writing are fantastic suggestions. I suggest On Writing Well at least once a day and The Elements of Style is the best reference to have on hand when writing anything long form. Both were given to me by my publisher when I decided to write a non-fiction book.
Peter Hickman
on 27 Dec 12For me the important books, the ones I lend out to people, are:
The Unix Programming Environment by Brian W. Kernighan and Rob Pike. Which showed me the “do one thing and do it well” school of programming along with the “then pass everything through pipes”. There are probably better books for this sort of thing but this worked for me.
AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis Doctors are not taught medicine by examining an endless supply of healthy people. They learn their trade by looking at the sick. Only by being aware of the mistakes others have made can you avoid making them yourself.
Notes on the Synthesis of Form by Christopher Alexander. It’s a damn good book with much to think about.
CRASH: Learning From The World’s Worst Computer Disasters by Tony Collins. The title says it all, out of print now but worth a read if you can get your hands on it. But then disaster stories about software projects are two a penny these days but in the world before the internet, when Usenet was young, this book condensed the major project cockups from the world of mainframes.
ploogman
on 27 Dec 12thanks DHH – nice post Wish you would write your own RAILS book (I know you are part of the gang of 3 (?) that wrote one but..) I would like you to write your very own, with full swearing and your own sense of humor throughout. That would be a good read. And also, some sidebars explaining why you decided to do certain things in Rails the way you did (which light was on? what problem did you solve?) Best to you
Adrien
on 27 Dec 12There has been a lot of interest lately in what constitutes good object oriented Ruby, and in particular insuring that objects are separated to the point where they don’t have to know about each other’s behavior. This of course is good design, which OO practitioners have known about since at least the late 1980s. An author of a book on the topic recently gave a talk, giving an example of a bicycle touring company. The suggested solution to designing objects for the company is to use three objects: a trip object, a mechanic object and a bicycle object. By passing a collection of bicycle objects from the trip object to the mechanic object, neither the trip nor mechanic objects need know anything about each other. This is indeed great OO design. However, the complexity doesn’t go away, it just gets pushed somewhere else. The mechanic object now needs to know the internal details of bicycle objects, which of course is not a bad thing since a mechanic certainly should know everything about the bicycles it repairs. It was further suggested that such a scheme will greatly improve code maintainability, an assertion that is only partially correct. If something about a bicycle (and there can be more than one type) or a collection of bicycles changes, the code inside the mechanic object also has to change. The point is that there can be no total separation of objects, at some point an object is going to have to know about at least some attributes and behavior of another object. And the programmer is going to have to understand how all the objects behave in order to orchestrate them correctly. Complexity doesn’t go away; the difficult coding has to eventually happen somewhere.
Some people have extrapolated the above OO design concept to Rails, claiming that by nature Rails prevents good OO design by forcing code to exist in either a model or controller. I’ve also heard the same people denigrate incorporating modules into Ruby objects. People who buy into those notions are essentially ignorant about the problem Rails solves. Rails is a framework for developing web applications. Web applications are complex creatures, required to integrate a set of technologies that inherently do not integrate cleanly (a web server, HTTP, databases both SQL and NoSQL, HTML, Javascript, etc.) and all of which are undergoing constant change. A web app needs to deal with asynchronous requests coming at it over the internet, using a stateless protocol. The web environment simply doesn’t lend itself to clean, ivory tower solutions. Rails has provided such integration in an overall satisfactory manner, which is why people use it. Rails has had to evolve, and will likely continue to do so. But to those who strive to tear apart Rails using specious arguments, they should try starting from scratch to build their own web app framework, at which point they will likely start to adopt a more pragmatic attitude.
Alphonse
on 27 Dec 12Don’t know what the hell you’re talking about but will let my “Programming” buddy check ya out!
ploogman
on 28 Dec 12@Adrien
Nice comment, I agree that OO design and programming is by nature, contrived. For really small projects, it actually can add to complexity, which has been one of the negatives of OO from the very beginning and that has not changed. And at least some of the “problems” that OO solves were already solved by procedural top-down design and programing (breaking a project down into named functions and procedures instead of one big pile of spaghetti code) which some say was already a form of OO design.
Rails is such an interesting framework. It eschewed PHP for the lesser known Ruby, a thoroughly OO language. It attempted to build on the OO nature of Ruby and capitalize on its special OO characteristics. It also took a look at existing MVC architecture and ideas and simply copied it, but along the way, David made it better in spots. Anyone who has ever toiled with web applications appreciated the “problems” that Rails solves, or at least makes easier! Other frameworks are good too. Some existed before Rails and some are inspired by Rails. Many are not based on Ruby. Anyways, just a nod to DHH for the effort he put into Rails, and appreciation for what his work has done, which is not just help people make web apps with Rails, but it has also inspired other frameworks based on other programming languages to adopt some basic tenants that seem simple, but had been lost to many prior in the confusion of building web apps at a frantic pace.
Denis
on 28 Dec 12Wow. Powerful blogger. My $7.49 Amazon order for Are Your Lights On? just got cancelled by the shipper. I went back in to try again and now the book can’t be had for less than $20. Not sure why some are listed at $750 and above (seems silly). Anyway, I guess that’s the free market at work. (but cancel my order!? just rude, I tells ya).
Lee
on 29 Dec 12Agile Database Techniques by Scott Ambler is a really good read for anyone who works with databases. Clean Code by Robert C Martin is also a book that I highly recommend (especially the first half)
Matt M
on 29 Dec 12The power of Signal vs. Noise: I just went to Amazon to see “Are Your Lights On” and noticed that the other 4 books recommended by DHH are in the top 10 “Customers who bought also bought…” section.
I’d be surprised if that had been the case before this post.
Thanks for the reading list – I’ll definitely be checking out a couple of these.
BS
on 29 Dec 12Yeah, what a bunch of shit! I checked the amazon price on all of these thinking I may pick up a few now and then the rest later. Then a couple days later, EVERY book has skyrocketed in price on Amazon (whether they were sold directly by Amazon or not). THAT is a steaming pile of crap!
Md. Razaul Karim
on 30 Dec 12The books are really good. I have read them. But 1st I have read some more things like www.certifysky.com
This discussion is closed.