So, What is spaghetti code?
Title is pretty self explanatory. since I hear it being used as an excuse or scapegoat for things., I want a good explanation for what it is and how it works. Just, I want to know all about spaghetti code.
Title is pretty self explanatory. since I hear it being used as an excuse or scapegoat for things., I want a good explanation for what it is and how it works. Just, I want to know all about spaghetti code.
It's the opposite of modular coding, where you code functions of your application in a modular fashion -- meaning that there is no lines of code that effect multiple features.
Spaghetti code, on the other hand, is where the code constantly references itself all over the place. This is bad, because then when you go to change one line of code to to modify feature 'x', features 'y' and 'z' have unintended changes because they referenced that same piece of code.
It sounds like 100% of game developers use the Spaghetti code method.
It can become tricky on large scale games, as the amount of people touching the code is massive. Not only that, you have people coming and going throughout the years, so the original people who wrote the code probably aren't even around anymore.
I think League in particular struggles with so many frustrating bugs because Riot started off as a smaller game company with a very tight budget, as opposed to a game like Heroes of the Storm where Blizzard has virtually unlimited funding and can release things on their own schedule.
That being said, Riot has had more than adequate funds for years now -- and I am personally disappointed with the development progress of the game. Sometimes it feels like the game is going backwards instead of forwards in terms of stability and reliability.
That being said, Riot has had more than adequate funds for years now -- and I am personally disappointed with the development progress of the game. Sometimes it feels like the game is going backwards instead of forwards in terms of stability and reliability.
With the reworking the entire projectile system, pathing, the networking, etc you can only do so much for the engine before having to rewrite the game. Hardly fair to say they have been going backwards.
Worse than a small company, it was a team of rookie modders making their first actual game.
everything is MINIONS
very good example of spaghetti code
everything is MINIONS
There is actually a legitimate reason for this. In WC3's campaign editor, many custom spells were made with invisible units. Presumably since this is all the former makers of dota (in this case Guinsoo) knew for creating games, they probably just wanted a platform that worked similarly. So we get minions being used for everything.
Sloppy coding basically where trying to change something will usually break a bunch of other things.
Code usually runs sequentially from one point to another, for example from an event through the various effects it should cause. The things that the code is doing are a bit like a straight line - like a single piece of spaghetti.
Now imagine that your piece of spaghetti is in a pot full of spaghetti. You want to figure out the path of instructions that the code follows, but to do that you need to follow the single strand of spaghetti through the whole pot, and trying to untangle it will probably result in you pulling other strands of spaghetti around or even breaking them.
To put that less poetically, spaghetti code is basically badly-designed code, where it's hard to follow the flows and interactions, and where changing something might well break other things. One concrete example might be a particular feature which is coded separately in each of the abilities with that effect, rather than them all calling one single shared piece of code to handle that feature - that means each of the places using that feature might do it slightly differently, have or not have different bugs, and generally might be inconsistent, and that if someone wants to change that feature, they need to change it in every single one of the places that use it, rather than just in once place.
The hardest part about spaghetti code isn't even debugging the problem; it's rewriting the segment of code.
Debugging is easy enough in many instances; find the problem, fix it in that one specific instance (sometimes by hard forcing values that should be automatically calculated), and boom, it's good to go.
Rewriting, on the other hand, means potentially destroying several currently working functions in order to make the code more modular.
That's the difference between fixing and patching. Patching code to make it run (even if temporarily) is easy. Fixing it, however, is a much, much more challenging affair.
The question becomes, would you be willing to have the entire game offline for several weeks to make it modular?
[{quoted}](name=Lao Fu the Tiger,realm=NA,application-id=3ErqAdtq,discussion-id=BeJpWatg,comment-id=0003,timestamp=2015-08-03T18:20:19.099+0000)
The hardest part about spaghetti code isn't even debugging the problem; it's rewriting the segment of code.
Debugging is easy enough in many instances; find the problem, fix it in that one specific instance (sometimes by hard forcing values that should be automatically calculated), and boom, it's good to go.
♪99 little bugs in the code, 99 little bugs, ♪You take one down, patch it around, ♪107 little bugs in the code
This is probably the most accurate representation of what happens with spaghetti code.
Wait. Wait. I have visual aid.
Title: When I change one line of code.
It's about half of Riven's power budget.
Man I went to respond and you guys already had this covered.
It literally has a definition as the first result on Google. It would've taken you less time to look it up than it took you to start this thread.
https://www.google.com/#q=spaghetti%20code
Spaghetti code is a pejorative phrase for source code that has a complex and tangled control structure, especially one using many GOTO statements, exceptions, threads, or other "unstructured" branching constructs.
It doesn't much matter to me, I didn't realize it really existed outside of League since I've only heard of it in conjunction with league. thanks anyway ^^
Y'all have been super helpful, I'm not a big coding guy (or even much of a computer guy) as is probably obvious.