Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
My rating: 4 of 5 stars
Dear Readers!
I’m happy to report that I just finished reading and reviewing another book on programming, this time, Clean Code by Robert C. Martin. It’s been a while since my last review, but I’ve been busy with C and some Matlab basics, so I didn’t have much time for this. As a “diversity break” though, I finally managed to read this, so here it goes:
If you are a novice or somewhat experienced programmer, then this book is for you. As an early programmer, you probably have little understanding of what is considered to be “good code”, so this book will give you a pretty good general guide for things you will need to look out for when writing code. Despite the fact that it demonstrates concepts through Java, it is still quite comprehensible, so don’t get scared if you don’t know Java (neither do I). Also, this book doesn’t only introduce you some heuristics, but also tries to explain what kind of mindset you need to write clean code, so this book is definitely worth your time.
It is not perfect though. For instance, I was constantly wondering what experienced programmers could get out of this. For novices like me, the gains are obvious, but for people coding for a while now, I’m not sure.
Also, I found some examples to be driven to the extremes. For example, I wasn’t really convinced of needing to over-split functions into tiny one-liners, and in the process unnecessarily obscuring intent by vertically stretching an otherwise obvious concept. There are a ton of good advice here, don’t get me wrong, but some of them just don’t feel to be completely justified.
In later parts of the book it becomes obvious though, that one must find balance in code refactoring, so the heuristics presented in the book should be considered as guidelines rather than rules (basically the book somewhat corrects itself).
Another thing I noticed is, that despite the fact, that the author(s) did a pretty good job at keeping most of the examples general, there were some cases where the examples are just too Java specific to my taste, so they simply became boring.
So is it worth reading? Of course it is. Is it perfect? No it isn’t, but that shouldn’t discourage anyone.
Thanks for reading.
P.S.: As a small bonus, to celebrate the finishing of this book and to welcome the very first snowfall this year, here’s a nice photo I shot today just out of the window:
A snowfall at the beginning of December. Not every year brings snow this early (around these parts).