A review by spyralnode
Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin

5.0

Essential reading for anyone who writes code - read it, use it as a reference, use it in your code reviews, in your pairing exercises, and made your code simple and expressive.

It has taken me a while to pick up this book, as I was already familiar with many of the concepts and the content from the beginning of my career as a software engineer, when I was really focused on improving the quality of my code and the productivity of my team. After I've moved into management, it's meant that every once in a while I need to work harder to restore my motivation and energy when it comes to interacting with code, because I just don't do this on a regular basis, and this book did the trick for me. So my recommendation is this: read this book when you are 2-3 years into your career as an engineer so you can visualise the consequences of these code smells, read it when you need a refreshing dose of motivation, and use it as advice when in doubt, it will serve you well.

It's not heavy in terms of too much code or too difficult code, it strikes that perfect Goldilocks balance of insightfulness and crispness. All statements are supported by examples and worst case scenarios, and some are intuitive (readability), some are more about thinking 2-3 steps ahead (extendability or maintenance). Let me tell you about some notes I took:
- Consistent indentation style was one of the most statistically significant indicators of low bug density;
- The indent level of a function should not be greater than one or two;
- The number of arguments in a function should not be greater than three;
- If you must encode either the interface or implementation, go for the implementation - it will pollute less of your code;
- Write for programmers: use CS terms, algorithm names, math terms and patterns;
- Separate solution and problem domain concepts based on level of abstraction;
- Make the code read top-down like a newspaper article;
- Functions should either do something or answer something, not both;
- Separate exception handling from logic blocks.