In a nutshell

  • Note : 18/20
  • Should you read it : oh yeah.

Why did I read it ?

I like conception books. I was very surprised by how friendly the book was, with the pictures and the style of writing. It was not just an enumeration of rules.

My review

I am not a huge fan of books with too much code and few explanations. Clean Code (or Coder Proprement) is just the best IT book I ever read. There is code, but useful code, and no pointless talk.

The book tells a story, the story of what a man has learnt through decades spent programming. You can feel the love of coding, the interrogations, the man changing his mind. Robert Martin shares his experience and tell us what seems right or wrong in his opinion.

The first (and biggest) part of the book presents Object Mentor's best practices and argues why they are best. They mention obvious good practices such as meaningful names, small functions, no duplications and some less obvious ones such as no comments, no checked exceptions, the importance of standards. There are chapters dedicated to error handling, boundaries (the use of external API), unit testing and concurrency.

What hit me most :

  • the boy scout rule or "leave the code cleaner that how you found it". I knew it was good to have clean code but I did not really realize how vital it was. It still isn't as important to me as it seems to be to Uncle Bob, but he trully convinced me into not committing anything I am not satisfied with in the future. The key is not to expect to have something great at the first try, but after many many trials.
  • keep things small. Really, smaller that you think, and everywhere : in classes (to be able to follow the Single Responsibility Principle more easily and to have cohesive classes), functions (which include the number of parameters). The code gets much more readable and testable when everything is small.
  • readability first. Even if it implies longer names or temporary variable.

The second part shows the process of refactoring code with case studies.

The last part is even smaller. It sums up the good and bad practices learnt.

I did not always agree with the book, but always understood the reasoning. More important, it was full of revelations. It taught me that clean code comes at a price, that behind it, there may be days of work behind, "just" for refactoring. Developping software really is craftmanship.

Buy it here