Anthony Ferrara has posted the latest in his "Beyond" series today with this new post - "Beyond Clean Code". In it he looks at the idea of "clean code" and proposed a different way to think about its creation.
This is the fourth post in my "Beyond" series. The previous three posts focused on re-imagining OOP and questioning some of the core beliefs that we have come to take for granted. This one is going to be slightly different, in that I want to talk about another angle of writing code: the process itself. We always talk about how code should be clean, but how do you write clean code?
He starts with an overview of what it means for code to be "clean" with some of the common criteria including clear code flow, short routines and using libraries for complex tasks. He proposes that a change in perspective is needed away from "pretty code" and more towards code that contributes to the business value of the product. Following through on this pattern of thought, he proposes a more effective method than focusing on just clean code - DIRTI (Develop, Isolate, Refactor, Test and Integrate).
The real beauty of this approach is that it assumes that you don't know your abstractions before you start. This will help you understand the problem (and the solution) as you write it. [...] Initially, when you don't fully understand the solution, you will develop, isolate and refactor over and over until you fully understand the solution that you're building. Once that understanding solidifies, you're going to tend to spend more time in the later parts (Refactor Test and Integrate).