Freitag, 17. Februar 2012

The path to clean code

Good software is not software that works. Well, it should work of course, but there is much more to good software than simply that it behaves like expected. Those who read "Clean Code", who worked on an agile project or who studied XP know this already. And I want to add my points of view to this discussion.
To me clean code is not an option - it's a must. Software delevopers need to learn not just to write code that works, but code that is maintainable, extendable, testable. I don't talk about XP, Scrum and all the other frameworks, techniques and development models. I'm talking basics here. It starts with naming your variables: The other day I looked at code with variable names like x, xmax, y, ymax. And this was not some 5 line script, this were 100 lines of code doing some algorithm stuff. Come on people, who is going to be able to read this? I really believe even the developer himself has a hard time figuring out what a variable mean what when he looks at the code half a year later.

I don't talk about the big changes, because for big change to happen, small steps must be taken. One year ago I didn't believe in small steps. I thought big. Well, much changed and now I see the value of small steps. Just as my daughter tries to spell the name of her aunt and just says "Nina" instead of "Katharina" because the long name is to hard right now, we have to write one test or add one pattern to our daily work. Of course, "Nina" is not the correct name, but this is not the end of the journey, it's the beginning. The alternative is to don't say anything and never lern "Katharina". Or, in the developers case, just skip the tests and never know for sure if the software works.

It's a hell of a long way from simply developing to milestones like 80% test coverage, continuous integration or delivery or a very low defect rate. But we are not getting there by standing around complaining. We are getting there by taking the first step. So let's start!

Keine Kommentare:

Kommentar veröffentlichen