Re: Just rewrite the lot as you think it ought to work. Call it refactoring if anyone asks.
I recently worked on someone else's code that was... terrible. Just really terrible. State information was stored as strings like "B13" to indicate that you are in part B step 13, everything was driven by line after line of twisty nested if statements.
My first inclination was to rewrite everything. I could have cut the size of the code in half, maybe more - but this was an existing, working system. Sometimes the right decision is to rewrite everything, but sometimes the right decision is to fix only what's broke. It takes experience to tell which situation you're in.
I recently worked on someone else's code that was... terrible. Just really terrible. State information was stored as strings like "B13" to indicate that you are in part B step 13, everything was driven by line after line of twisty nested if statements.
My first inclination was to rewrite everything. I could have cut the size of the code in half, maybe more - but this was an existing, working system. Sometimes the right decision is to rewrite everything, but sometimes the right decision is to fix only what's broke. It takes experience to tell which situation you're in.