Sometimes leaving the spaghetti alone IS correct. Sometimes it isn't.
But most awful spaghetti happens because what it was asked to do was awful, IMHO.
Sometimes leaving the spaghetti alone IS correct. Sometimes it isn't.
But most awful spaghetti happens because what it was asked to do was awful, IMHO.
I'd expect even rather junior programmers to recognize that the more time you spend working on a project the more new and unexpected things you find. New features, better ways to implement things, whatever. And ultimately, we all look back at code we wrote a year ago and are going to say "what idiot wrote this garbage?" I mean, if you don't, it is probably a sign that you aren't improving. It's impossible to write perfect code, and even if it was, what would be "perfect" is a moving target. So either way, you should be writing better code today when compared to yesterday.
> without the expensive big rewrite.
While it isn't possible to completely put this off, I find there's a helpful tactic to reduce spaghetti-creep. "Maintenance is cheaper than repair." People say "don't fix what isn't broken" but I think that's wrong. You should "fix" things before they are broken. Because frankly, it is cheaper to replace your visibly degrading water pipe than it is to wait for it to burst. You not only have to pay for the new pipe, but all the damage it caused when it broke. Maintenance increases longevity and helps you monitor so you can replace things before they break. Doesn't matter if you're plumbing water pipes or plumbing spaghetti, the tactic is the same.