Book Review: Java by Comparison

Here is my review of the book Java by Comparison - Become a Java Craftsman in 70 Examples authored by Simon Harrer, Jörg Lenhard, and Linus Dietz.

TLDR Version:

As I was reading the book, I felt why this book didn't exist when I started my profession as a software developer. If you are starting your career as a software developer and already familiar with Java, I would highly recommend you to read this book to get good at developing maintainable software that delivers value. If you are already a professional, you might still find some tips or reinforce what you have already learnt.

Longer Version:

As a student, when I started coding, the syntax of the programming language was the biggest hurdle to cross. However, practice made me a better programmer. As I started enjoying programming, I started working on a few pet projects. That made me realise that working code is only the beginning, not an end in itself. Mainly, I had to modify the functionality, upgrade dependencies, and evolve my software. I realised I am spending more time reading code than writing.

Entering professional software development, I had to figure out the code that requires a change in a pile of code. So navigating code was taking more time than reading or writing. Over the years, I have learned from the bad code that I wrote and written by others by experiencing the pain. (I have written about one such instance here).

Reading 'Java by Comparison' made me recollect the memories of learning several of these by the first-hand experience over the years. Indeed, had this book been available then, I would have learned much faster. However, the good thing is that the new generations of developers have an opportunity to read the book and accelerate their learning.

Most software projects are driven by time to market in the beginning. However, not paying enough attention to maintainability can lead to quicker decay of software and harder to evolve. Writing clean code can certainly help reduce the rate of software decay and reduced cost of adding new functionalities (and reduced cost). The book focuses on getting better at developing clean code and does it well. Of course, it uses Java as the language of choice to communicate the ideas.

In the first eight of the nine chapters, the authors start with working code and identify one specific area where the code lacks maintainability. Then they present the solution with a commentary. The content ranges across naming, comments, design, documentation, error handling, testing etc. The last chapter breaks this format and covers some important aspects concerning taking your application to production.

I liked the format used by the authors - starting with a piece of code and improving it. Comparing these two makes it easy for the reader to grasp the problem and how to address them. I feel the authors have done a commendable job in selecting the code examples. It takes an enormous effort to pick the simplest possible example that would potentially convey the message.

I am highly confident this book would help the budding software developers to get better at their craft. I congratulate the authors for taking this initiative.

Show Comments