Acorn Heroes

A contented soul

by 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.
Refactoring is far from being just a rewriting of code.  It’s a re-imagining of code, finding the simplest, most elegant form.  An optimisation if you will.  Chicken Soup for the Programmer’s Soul.
And the result of the latest refactoring of the family home?  A comfortable work place – Acorn Heroes HQ:
Acorn Heroes HQ - complete with resident beta tester.

Acorn Heroes HQ - complete with resident beta tester.

OK, next time something a bit more technical with a hint of Battlestar Galactica.  I Promise.

No related posts.


2 Comments for this entry

Leave a Reply