And so, to the point that we care about how clean code is, we only care about that in so far as it has an affect on our end product.

Casey Muratori

I used to care deeply about writing code that was as clean and elegant as possible. Functions should be short, and do one thing only. Don’t repeat yourself. Don’t have functions take more than three parameters. Functional programming has some rather elegant abstractions around manipulating lists of things too, and it was easy to feel proud of expressing a complex transformation, in a few lines of careful crafted maps, filters, and reduces. Yet somewhere is the background of my perceived ‘clean code’ lies the actual problem I am trying to solve, buried under layers and layers of ‘beautiful’ code.

If the way you look at code is that you think of it as messy or clean, that is a very bad habit in my opinion.

Casey Muratori

Enter Casey Muratori (of Handmade Hero fame) and his paradigm-shifting rant on why seeing code as messy or clean is a really bad habit. 1 His perspective was different and refreshing, and reminded me that code is merely a tool that we use to solve problems, and that our job is to solve those problems, not write ‘clean’ code. I’d summarize his salient points as follows:

It’s easy to gravitate towards the path of least resistance, and focus on things that are superficial, under the belief that they are more useful than they actually are. It’s far harder to focus on what actually matters.

  1. I highly recommend watching the whole lecture What Programming is Never About, by Abner Coimbre. It’s thanks to him that I actually heard Casey’s opinion on clean code.