Joel Spolsky argues that rewriting software is always a bad idea, and in his latest essay gives an eloquent description of how refactoring let him rewrite his company's flagship product without starting from scratch.
When Eastgate started to plan Storyspace II for Macintosh, we did precisely what Spolsky argues a company should never, ever do: we started from scratch. That was, in the end, the right strategy. But Storyspace I was an unusually old program: some of our Storyspace titles are probably the oldest continuously-available consumer software in the world.
Refactoring is one of the most important software concepts of the decade.