in reply to Maintenance vs. Programming style

If your task is to enhance-or-debug, then by all means limit yourself to that. But obviously during the process of doing that you must also make “triage decisions.” That is, “is this corpse worth saving?”

Many things that stink are not dead, however. (In fact, quite a few things that I have written over the years acquired quite an ex post facto “smell” even to me.) You don't need to rewrite all that. Doing so won't necessarily make it any better at all.

All of us have worked in, or with, shops that had “famously bad code.” It was this-or-that module which was so constantly broken that people became adept at – even proud of – nursing it along. And you just gotta make that “dead-horse decision,” pull the trigger next to Old Dobbin's head and replace the damm thing with what it should have been all along. Sometimes you determine that this is simply what you have to do, but it should not be something that you simply do as a matter of course. The code may stink, but it's bought-and-paid-for.