What to Know about Clean Code


What is clean code? Why does it matter? 

Can clean code set YOU on the path to programmer glory?

If you make your living programming, “Clean Code, a handbook of agile software craftsmanship” is for you. 

It’s useful regardless of the languages or methodologies you are using.

I’ve hired, trained and managed dozens of programmers and I’ve got some strong opinions. In interviews, I ask what books you’ve read. 

If you mention “Clean Code”, that’s a point in your favour.

Personally, I’ve gotten over a hundred thousand dollars in benefit from it.

G’day! Welcome my friend to WTK, the “What to know” show.

I’m your host Peter, Whelan.  

I prefer clean code over dirty code OR tidy code over messy code.  Work through this book to know what I mean by that.

I HAVE worked with programmers who thought “I’m so GOOD I know it all, nothing for me to learn”

WELL, not to be impolite, but, a programmer who stops learning is average and is on their way to being below average.

But, that’s other people, not you. You’re watching this.  You’re improving your skills.

As you know, you’re going to have to put effort into your career.  

Working through this book is a useful exercise that takes 4 to 6 days of effort.

Notice that I said, “days of effort” I make the distinction between the days of effort and the duration.

That’s an important distinction.

Most of us are too busy delivering on the demands of the business to reflect on the process of programming. 

Fortunately, Robert Martin and the other authors I recommend, have put a good deal of thought into it. They share what they’ve learned through books, videos and consulting.

Robert aims to bring more professionalism to our field.  I’ve heard him use this analogy. 

Imagine you are surgeon and your patient is screaming at you to remove their appendix before it bursts. 

You reply “I have to wash my hands first.”

Your patient says, “Forget it, operate now, I can’t wait, I waive all liability.”

A surgeon would be committing malpractice if she complied with that demand. 

The surgery might be a success, but the patient could die from infection.

Likewise, you may have a boss who demands you keep cranking out new features without testing or cleaning up the code.  You could be killing the business for short term gain.  The way to go fast is to keep the code clean. 

The time you save by not testing and refactoring is used up later dealing with complaints of bugs in a lousy product.

Clean code requires attention to detail. 

That’s why I use the Van Halen test when I’m hiring. Check out my job openings video if you’re curious about that.

A Bob has predicted that, if you’re not doing Test Driven Development, then you won’t be able call yourself a professional.

That got my attention.  It’s kind of insulting. It fits in a tweet and what’s Twitter for if not insulting strangers?

I’ve worked with professionals who aren’t using TDD.  But the idea is “directionally pleasing”,  I like where he’s headed with best practices.  Watch my “What to know show on TDD” to get started with that.

Apply what you learn in “Clean Code” to reduce your code review WTF per minute rate.

It’s funny because it’s true. I work through “Clean Code” from time to time. 

The book hasn’t changed since 2008, but I have. 

I have more experience, more questions, new realizations. HOLD. There’s a lot in here.

Reading will only get you so far.  Teach these concepts to a coworker.

The more you share, the better you’ll understand it and we’ll all do a better job.

Odds are, you won’t grasp everything on your first pass.  By working through this repeatedly, you’ll be a better programmer. If you want to be.

Discuss this online or with a coworker.

The more you share, the better you’ll understand it.