"Just fix the spaghetti code."

Lao Fu the Tiger·9/11/2015, 1:52:11 PM·21 votes·4,041 views

Quotes such as these are a little bit... well.. misinformed.

This is a very short post, but while "spaghetti code" can cause lots of problems, many times the problems aren't related to "spaghetti" at all; code overlaps sometimes, and exceptions have to be created in certain cases where intended output doesn't match the implemented output perfectly.

Furthermore, it's not so easy to "just fix it." It takes lots of time. Anybody who's taken a class that's higher than a 101/102 level computer science class and has gotten into object-oriented languages knows that knowing all of the modules or classes you want beforehand is nigh impossible; furthermore, since League is a constantly evolving, constantly changing game, some things are bound to get hairy sometimes. And when things get hairy, solving the problems, or restructuring the entirety of a block of code (as with projectiles), becomes challenging and time consuming as well.

I get that you guys want everything perfect, but blaming everything on code being "spaghetti" is a bit of a misnomer. It's not easy to know off-hand how any given piece of code will affect every other piece of code. Even harder is knowing that making a certain change will cause problems elsewhere.

Welcome to the world of computer science :)

16 Comments

Riotjmccaffrey9/11/2015, 11:34:13 PM12 votes

Hey, glad you are bringing this up, and I'd like to take a stab at answering.

I've been at Riot since before we went Alpha, and have spent most of my time on the tech side working on a bunch of different areas of LoL.

When we started, we had a small team of developers working on a relatively small amount of systems and features. We did the right thing by getting the product out, getting LoL launched, scaling to the next big milestone, etc...

Today some of that code doesn't fit our needs anymore. Our champions may need more from the spell system than it was designed for, skins may need more from the animation system. This extends into all parts of the product, so even things like our account system are stretched by today's needs.

I agree that spaghetti code is an over simplification of the problem in some of these areas, but the reality is that as we grow we need to continue to re-factor and improve the foundational layers of the game, the platform for the game, and the large ecosystem of products and systems around it. A general thing for us at this point is that when we go to deliver a feature, we can probably assume there will be some foundation work to do, and that's ok. That's the difference between working on a brand new product and something like LoL which has been in production for many years.

Some areas, like our client, are especially constraining and are also especially challenging to fix; these are areas where major investment is required across a number of teams, and right now we are putting a lot of resources in making better. This isn't to just make the code better but to reduce bugs, improve stability and performance, and overhaul the design so that players feel good about using it vs now where its obviously janky.

I hope that helps to clarify a few of the kinds of things we are thinking about when we say spaghetti code.

XaviorZeroBlazer9/11/2015, 1:58:31 PM3 votes

don't betray the secrets of coding, the fools who don't know will never understand the nuance and abstract thinking required to do OOP

Z Statistic9/11/2015, 1:56:45 PM2 votes

Just to play devil's advocate, isn't there a programmer/programming team whose one and only prime directive is to update code blocks every few months to untangle this pile up of code so that the tangling doesn't ever get too messy? And if there isn't, why not since this problem WILL eventually occur AND the consequences are dire.

D Bag9/12/2015, 7:53:05 PM1 votes

Just add some meatballs and parmesan cheese into your spaghetti code. Bam! You're welcome Riot.

http://www.auplod.com/u/auopld60eff.png

Jasiwel9/11/2015, 7:22:54 PM1 votes

I think most people rage about it because they think 5 years is a long time to perfectly modernize an old engine. Given everything else the engineers have accomplished/implemented in the past 5 years on top of probably untangling the old code at the same time, I'd say they're on par with the course. Aside from creating a brand new engine that doesn't have spaghetti code to begin with, it's considerable difficult to fix old engines without having hiccups/bugs.

Live2LetDie9/11/2015, 2:49:44 PM1 votes

The problem is their code is so outdated. They stated they need to rewrite the engine but that would take a lot of time. It's like trying add ps4 graphics to ps2.

Photos of Ghosts9/12/2015, 7:32:45 PM1 votes

THANK YOU for not spelling it "spagetti". That makes me so mad.