Does It Work?
This conversation sparked itself spontaneously today:
Jonathan: If you see a piece of ugly code, what do you do?
Me: Does it work?
Jonathan: Yes.
Me: Then let it work.
Jonathan: Then why do we refactor?
Me: Does it work?
Kevin: The meaning of work here is more than correctly executing an algorithm. If a piece of new functionality cannot be easily added, then the code does not "work" in a broader sense.
Re: Does It Work?
Re: Does It Work?
Re: Does It Work?
I've let code get smelly on almost every project I've worked on. I must admit, I regret it every single time!
The main reason being that often when I want to work with the code again, I don't feel I have the time or inclination to play clean-up. I then end up making the code even more smelly, and over enough iterations that significantly slows me down, and makes my job far less fun.
For any new development work, I'm striving toward the "continuously refactor" approach - that's my ideal. For older legacy stuff, I'm just going to have to keep trying to talk myself into refactoring more, and making sure I have supporting tests.
Don't get me wrong, not all my code is horrid, bad and smelly! It's just that whenever I do make a mess, I very rarely get away with it ;-)