Today I thought of an analogy to describe what I was doing to a bit of code. It had been handed around, added to and re-used and had come back from my customer with some additional requirements to do on it.
It very nearly did what was required but not quite, so I found myself adding, adjusting and messing with the logic. I did all this with an air of frustration because I knew it was getting a bit smelly. I also really hate re-writing code.
It occured to me that this is like re-painting a door by just painting over it, eventually it ends up a lumpy unpleasant mess.
What I did was get the code-stripper out and had a look at the actual requirements, strip out the old code and re-write. It took an hour or so with lots of testing but I ended up with nice, easy to understand block-diagram. This paid dividends on delivery to the customer because they promptly found a load more new requirements for it, all solved nice and easily.
Code Smell#5:Over-painting
Code Deodorant/ Code-Stripper: Stop tweaking and go back to the requirements!
Only a very short blog today, but coming soon is a joint effort by me and Jon Conway, the first thing (apart form Christmas Cards) we've co-written for over 10 years.
Lots of Love
Steve
Steve
Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.