A contented soul
by George on Apr.11, 2009, under Uncategorized
Every now and then, my wife and I get a sudden urge to rearrange part of the house. Normally it’s a part of the house that gets unusually messy, or feels like wasted space. What results is a more useful area that is generally easier to keep tidy. It’s also accompanied by an immense feeling of satisfaction.
In the middle of one such episode this weekend, I realised that this is a perfect analogy for refactoring code. To a non-coder, refactoring must seem like a waste of time. The code you have works, why rewrite it? Aren’t you at risk of adding more bugs to the code base? The thing is, refactoring code is just like rearranging the family nest – it’s based on a desire to revisit past decisions and make things better. Consider the following statements, which apply in both cases:
- The result is easier to keep tidy and make use of.
- Things that were in the way find their proper home where they can be useful, rather than annoying.
- Unwanted cruft is removed.
- Time that was spent keeping this mess under control can now be spent on more useful things.
- It looks and feels fresh and interesting. Suddenly it’s a place that you enjoy spending time in. When you spend a lot of time in a place, it helps to be happy to be there.
OK, next time something a bit more technical with a hint of Battlestar Galactica. I Promise.
No related posts.


April 11th, 2009 on 9:18 am
Wow, i’m on tenterhooks for the next installment ;D
I love having refactored code… refactoring it? not so much.
April 12th, 2009 on 11:36 am
Maybe its just me – but once I finally get the enthusiasm to tackle a big refactoring project, I really enjoy the challenge…