3 ms·
It is hostile because I've seen people mess up optimization too many times. Sometimes leaving the spaghetti alone IS correct. Sometimes it isn't. But most aw
by ilc 1y ago
It is hostile because I've seen people mess up optimization too many times.
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.
- bluGill 1y agoNearly all the awful spaghetti code I've seen started out as good code, but as requirements changed in unexpected ways fitting the new features of version 5.0 while keeping all the previous version features working resulted in a mess that nobody knows how to clean up without the expensive big rewrite.
- godelski 1y agoThis has been my experience as well. A real "the road to hell is paved with good intentions" situation. No one was intentionally acting malicious nor trying to make bad code, but the ultimate truth is that software "rots". We write for static environments, but the environment isn't static. 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.