Clean Code

A book review

Clean Code

Introduction

Throughout my career as a software engineer, certain nuggets of wisdom have come my way. I may pick some up from co-workers, from reading blogs, or often enough the old fashioned way - learning from my own errors.

I have tried to pass along what I have learned, to train newer software developers on the good things to do when writing applications, what not to do, and why. My key phrase I have latched onto is “maintainable code”. I’ve written my own guides on the subject; internal to companies, in public blog posts, and most often as comments in pull requests!

Over the decades, my expertise in my craft has grown and I’ve tried to give more back.

Then… something happened. I met Uncle Bob.

Not in person, unfortunately, but somehow I found myself to his web site, videos of his speeches, and finally to his book: Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin.

I have been wasting my time. 😉

This is the holy book of programming. All that I have discovered, is right here. In fact, this is the source of much of the advice I received over my many years.

I had heard of this book before, certainly, but actually read a book? On paper? For so long I have been learning online that this seemed quaint. Well I’m glad I finally gave in. I’m here to say: read this book! On Paper!

But why?

First off, after twenty-five years or so, there’s little in Clean Code that I haven’t heard before. So why read it now?

  1. Uncle Bob doesn’t just say what to do, but convinces you why you should do it.
  2. It’s all the advice on how to craft code in one referenceable manual.

That first point is where the biggest value has been for me, because even though I knew most of this advice, I wasn’t following all of it.

The second point make my goal of training up developers easier. Much of what I have written, and have been planning to write, is already in this book! When I see someone in need of learning, instead of writing a dissertation, I can just ask for their mailing address and send them a copy of Clean Code!

Here’s the crux of it: this is a shortcut to performing as a top-tier senior engineer!

  • Buy this book (don’t borrow - you want to have it handy).
  • Buy it on paper. (Flipping pages to reference code example isn’t so easy in a PDF, and e-books mutilate formatting.)
  • Read it.
  • Put what you learned into practice.

Could it be better?

Clean Code has one big flaw prevalent throughout: Java.

The author’s mindset is in Java. The examples are all in Java. Not just the code examples, but even the text assumes you know common enterprise Java concepts and tooling.

Back when Clean Code was written in the first decade of the 2000’s, Java was the language of enterprise application development, so it makes sense. Ten to twenty years later though, the book frequently refers to Java ecosystem concepts that won’t make any sense to someone who didn’t go through that era. It’d be great if new editions where made for other modern programming languages.

For the most part though, these Java-centric concepts can be glossed over by the reader. You could be writing in anything from C onwards and easily apply the lessons here, because most of them are timeless and most languages follow the same concepts. True functional languages may be the most distant from Java, but still I think even these programmers will find valuable lessons in Clean Code.

More Must Reads?

Are there other must-read books for software engineers and architects? Put it in a comment.