Recommended Reading for Java Developers

August 7, 2008 1:18 PM

Back in 2002, I wrote “Five books I think you should read if you hack Java”. I was a much more novice developer at the time and the book list reflects that. Still, such a list makes a great baseline, and there are very few changes I would make today. With the recent release of the second edition of Effective Java, I thought I'd revisit the list.

If I were writing it today, I would reluctantly remove Refactoring. While the advice on what refactoring is and when it should be applied is still gold, most development environments support refactoring natively these days, so the detailed manual processes described in the book seem rather archaic six years later.

In its place I would put Java Concurrency in Practice. Every new Atlassian developer gets handed this book and ordered to read it immediately. Writing multi-threaded code is hard, and a number of the things Java does under the hood to make its multi-threading more efficient makes it even harder. Unless you understand the subtleties described in this book of how Java shares data between threads, you will screw it up in some almost-impossible-to-debug way.

Speaking of Effective Java, a book so essential that we ordered ten copies for the office as soon as we knew there was a new edition, I decided to give it a read. Of course, I have over half a decade more Java experience than I did when I read the first edition, and I was really only reading it to see how Java 5 had changed some of the book's recommendations.

Wrong. In just the first chapter I learned three things I really should have known already, but didn't, at least one of which I'd probably read in the first edition and then forgotten. I guess it goes to show that you never stop learning.


As an alternative, consider removing both of "Design Patterns" and "Refactoring", and replacing it with "Refactoring To Patterns"; this is more practical than "Design Patterns", largely because it focuses a lot more on how to identify when you should be using the pattern in existing code.

"Refactoring" is still essential reading. The important thing it teaches is not the details of Move Method, but the strict, step by step process of shifting code around atomically. That process will never not be necessary.

There will always be a refactoring that your IDE does not support, either because it's not common enough or because it's not automatable for whatever reason, and knowing how to get from A to B manually in a safe, repeatable fashion will save your ass at some point.

HOW ABOUT "domain driven design" ?

A couple of other books in an "excellent supplemental" category would be:

"Interface Oriented Design" by Ken Pugh. In some ways this is likely well covered by other OOA/D books - but as Interfaces are a major differentiating factor for Java it's well worth a read to improve understanding of various trade-offs when using them.

"Implementation Patterns" by Kent Beck. Features some of the better discussion on the actual process of writing code that is readable. Helps you write cleaner code - and understand the trade-offs to using certain phrases or constructs in your code.

Previously: Quote of the Day

Next: Raphaël