October 11, 2005
Pass the Gas Mask!
Ever found yourself in a seemingly never-ending spiral of attempts to refactor code with the aim of getting it into a fit state to implement a change?
You spend some time analysing a method to understand what it's doing and then do the right thing and refactor it, perhaps using the Compose Method refactoring. Then you find something else that, to use the refactoring jargon, smells. You make that code better, pat yourself on the back and prepare to start implementing the changed behaviour. But you can't; there's yet more pungent code blocking your path to an elegant solution that will be better in the long run.
Sometimes I think the Code Smell metaphor is too mild. Even Code Stench can be insufficient. The image of being trapped in a sewer full of toxic fumes would be more apt.
Pass the gas mask and show me the way out of here!
Posted to Software Development by Keith PittyThose are some of the most frustating situations. Michael Feathers _Working Effectively with Legacy Code_ has a ton of great ideas for working through tangled code like that.
Posted by: Rob Sanheim at October 11, 2005 11:19 PMThanks for the recommendation Rob. I've added it to my Amazon wish list.
Posted by: Keith Pitty at October 12, 2005 10:32 AM
