Review of "Clean code" by Robert Martin

Clean Code A Handbook of Agile Software Craftsmanship by Robert Martin.

"Clean Code: A Handbook of Agile Software Craftsmanship" by Robert Martin, ISBN 978-0132350884

The book makes a great companion to Martin Fowler's "Refactoring: Improving the Design of Existing Code". It is practical, easy to read, and covers a lot of ground. I would highly recommend this book to every developer. The author gives lots of concrete examples while discussing refactoring classes, functions, comments, etc. The book starts with giving definitions of clean code by various software visionaries, before the author skips giving his. Instead he defines clean code as a composition of his advice on clean functions, clean comments, clean variable names.

The book devotes a chapter to making each part of the code easier to read (and by extension in author's opinion easier to write). I mostly agree with the advice, and found the discussion of data structures vs object oriented programming interesting and fresh. If there was one downside to this book, it is its exclusive focus on Java language. I don't care for this language anymore.

My second objection is to author's suggestion that the best setup for running unit tests for a project is a single button or keyboard shortcut inside an IDE, while the worst setup is single command from the command line. For me, it is the reverse: I stopped relying on any IDE to build, instead always prefering the command line tools. This way I am not at the mercy of IDE developers or weird shell limitations. I also get the most important portability: the exactly same command that I run locally can be run by the continuous build server.

These are very minor quibbles to an otherwise excellent book.