I think true spaghetti code requires teamwork. I mean that seriously. You need at least 3 people all with different incomplete and incorrect mental models trying to modify the same codebase at the same time.
I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work…
TerrariaClone – An incomprehensible hellscape of spaghetti code
81–90 of 289 posts
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#82But now the author here says they're doing that same thing! How has this not inevitably led to problems? Or am I misunderstanding the scoping in Java?
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#83As Ive gotten older, I have severely relaxed my dogma on coding standards. I agree that code should be maintainable, legible and logically formed. Sometimes though, you just need to get things done, and architecting a large solution of abstractions and frameworks, just doesn't seem like a good use of time.
Some things I care about a lot less, others I care about more. The biggest problem I have is with obscure code, and my understanding of obscure has shifted over time.
Basically, I prefer code that gets you to ask the right questions. I'm still trying to put my finger on what qualities those are.
I still care about code that looks one way but does something else, and I care about code that conceals what it's doing and how it accomplishes it by using convoluted delegation.
But a function with a single purpose and clearly named? If it's loaded with kruft I only care if it's on a flame chart or I have to keep stepping through it while debugging another issue. So I care more about functions in the middle or the top of the call tree and less about the leaf node ones.
I still push back on "It's not that hard to figure out this code" on the grounds that when an odd bug happens I'm going to be scanning dozens of functions trying to spot an issue. If every one is chock full of code smells, that process takes forever. In fact it discourages people from doing the right thing and instead they slap more workarounds on top instead of trying to find the real cause.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#84Earlier quoted context omitted.
I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work…
I'd say one person over ~12 years is basically multiple developers working on it. I look back on code after a couple months and it often feels like someone else wrote it.
[Edit: I don't blame him - I understand how it happened, and also why he wanted to get out ;)]
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#85Grunge C and huge comment block at start, compiles and works though. One day, I'll revisit this and have a think about data structures.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#86Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#87Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#88Earlier quoted context omitted.
I agree. But then again, I'm like a completely different programmer than I was a few years ago, and even more different than I was years before that. I've got some long running personal scripts and projects I tweak every so often, and the end result is pretty much the same. "What the hell was I doing here? Whatever... I'll just add a bit of code and get it working. Done."
That describes my experience with some of my GitHub projects fairly accurately. Actual commit I did a few days ago: > Begin rewrite of rewrite of rewrite
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#89Earlier quoted context omitted.
One of the things it took me a while to intellectualize is that 'you' a year ago is a very different person from 'you' today. Given enough time, maintaining a much larger body of code than a single person can reasonably handle, you're going to have disagreements with yourself without even realizing it.
Absolutely. When I stumble upon some code in my full time codebase that I find distasteful, my first thought is "what idiot did this". git blame and sure enough, it's me. Past me has been and always will be an idiot as far as present me is concerned (with some infrequent exceptions).
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#90I love DoubleContainer: https://github.com/raxod502/TerrariaClone/blob/master/src/Do... which is fortunately only used in a comment here: https://github.com/raxod502/TerrariaClone/blob/9ea04b15add48...
I'm sure there was a good reason for that.