Book review : Clean code
I recently finished Clean code, from Robert C. Martin (well, in fact it’s mainly from him and some guests, but then..).
Anyway, the focus of this book is how to write clean code, meaning readable and maintainable code. For this, the authors go at length on the different aspects, dedicating whole chapters to aspects like “Meaningful Names”,”Functions” or “Comments”.
At first glance, these chapters can seem a bit boring, containing mostly “common sense” point. However, all put together, I really have the feeling to understand way better how to write clean code. We all know that methods should be short. But who does so actually ? Now, I try to : the book really convinced me of applying these “rules”. And I really feel that my code is getting more and more readable… Nice feeling, enough, I would say, to recommend reading this book !
However, don’t expect a “perfect book” similar to Effective Java. Indeed, some chapters are either way too superficial, like the one on concurrency (and even the appendix on it), or simply boring : the refactoring examples aren’t compelling at all. They even seem a bit odd, since this book isn’t explicitly about refactoring (more on these kind of books another time lol).
Finally, the last chapter of this book should please every reader of this blog :chapter 17, “Smells and heuristics”, provides a summary of many codesmells (summing up most of the book), which are at least nice to have in mind.
Overall, I think this book helped me a lot to improve my “clean” code ability. It’s nice as shiny as patterns or the like, but that’s the code we write and read everyday !
I think as well it’s the kind of book worth being read again after some time… In fact, I was already reading it again recently. I found some interesting points on the “introduce null object pattern”. Even better, some topics covered matched exactly some issues I had encountered just before, providing very good food for the mind !