Pat Kua posted some notes from Michael Feathers’ Brutal Refactoring. The notes are good but what really caught my eye was the distinction between Clean Code and Understandable Code.
He makes the point, using some good examples from different languages, we can live with understandable code, and there is a cost to having Clean Code, particularly when you have it.
Thinking about it a bit, it takes a bit of work to convert code into Understandable Code. Typically this is what happens when you do a series of refactorings and general clean up.
In order to take that code to Clean Code you’d need to first make it Understandable and then go back through it to clean it up even more. Looking through the example from Clean Code for Args, I’m afraid that Clean Code can even be taken too far. For a long lived system that has its requirements mostly fixed, I can see the benefits of Clean Code. Most of the systems I see, especially in Rails, are more fluid and changing so putting in the time to make all of the code Clean would be overkill.