Posts Tagged ‘refactoring’


Tuesday, March 4th, 2008

Currently reading Refactoring by Martin Fowler. Yeah, any programmer worth the space he/she takes up is going to do some version of refactoring, but this is really attacking refactoring with a systematic, safe, testable approach. It seems like a better way of approaching it than the normal way:

  1. Oh god, this code sucks, it makes me stressed just to look at it…
  2. Destroy, destroy, destroy
  3. Humpty is shattered across the floor
  4. Put Humpty together again (universally known to be non-trivial)
  5. If the step above didn’t end up as an endless pit of pain and despair, things are actually much, much better!

Something that doesn’t involve the level of inoperable destruction in step 3 but still gets to the same final state is probably an improvement! Giving these refactorings names seems like a good way to keep the operations concrete an separate in my mind, and will help in future conversations. Good stuff!