Earlier quoted context omitted.
Truthfully - I wouldn't call it spaghetti code. I think of spaghetti code as way to many abstractions (AbstractEntityFactoryFactory). This code has the opposite problem - needing more abstractions - which is the easier direction to move.
Global state causes code to be spaghettified. Having worked on several code bases that qualify as spaghetti code, the hallmark trait is that the execution flow is wound back around itself many times, like noodles in a bowl of spaghetti, in a way that's not easy to trace. You may have nice abstractions or none. You may have deeply nested type hierarchies or a seemingly nice flat structure. You may be using an IoC cont…
TerrariaClone – An incomprehensible hellscape of spaghetti code
131–140 of 289 posts
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#132This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…
Give yourself permission. I have a GitHub repo called "junkcode" for this very purpose - sometimes projects are promoted out of there, sometimes not.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#133I 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…
If you don't then you are basically one developer doing a serial simulation multiple developers miscommunicating in parallel.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#134This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…
Give yourself permission. I have a GitHub repo called "junkcode" for this very purpose - sometimes projects are promoted out of there, sometimes not.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#135Earlier quoted context omitted.
Give yourself permission. I have a GitHub repo called "junkcode" for this very purpose - sometimes projects are promoted out of there, sometimes not.
I like that idea a whole lot. I tend to just throw stuff on GitHub. Some is prototypal. Some is polished. Some is just terrible in every way. Your approach seems better, and is aptly named.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#136When I first started programming (this was in C++), I decided that the obvious optimisation was to declare all these redundant local indices i,j,k as globals. Then the program won't need to make all this redundant crap! Of course that led to absurdly subtle bugs that only occasionally showed up since whenever I called a function which had a loop in it from inside of another loop, I would use i as the index for both l…
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#137> The TerrariaClone.init() method, which is over 1,300 lines long, actually grew so large that the Java compiler started running out of memory trying to compile it! Seems surprising, 1.3kloc doesn't feel that big in the scale of things. I wouldn't be surprised if some of the methods at $work would be on the same scale, and it compiles just fine (relatively speaking..). And based on quick scroll-through, there isn't r…
https://stackoverflow.com/questions/17422480/maximum-size-of...
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#138Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#139Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#140This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…
watching the creator of The Witness do some live stream coding made me realize this too. he just typed the convenient thing he needed at each moment and didn't try to abstract away the mess. just forged ahead.