At least once in his life each developer shouted “What the fcuk?! It must be rewritten!”
But the decision to rewrite shouldn’t be taken lightly. Below is the nice video Chad Fowler and Rich Kilmer walk through the pros and cons of Rewrites and give real world examples of Rewrite strategies that work and that fail.
Update: The mentioned video was deleted from Vimeo by some unknown to me reasons. And I had no luck to find it on other resources. But below is the link to the post of another giant of the programmers world. The used words are different but the idea is still the same: