User blog comment:Alartan/League of Legends as software, according to CapoFerro/@comment-1330314-20150528172321/@comment-26442788-20150528184051

Can everything be modularized?

As a general rule, yes, everything can be modularized, but the challenge of modularizing components varies from bit to bit and we always have to make tradeoffs between how quickly we ship a feature and how perfect we want to make the code.

It's good architecture to keep similar functionality together and to treat a component's exposed methods and functions as a proper API. The underlying implementation of a component should never matter to the rest of your application. I'm using the term "component" very loosely here. This could mean something as simple as a single function or as complex as an entire subsystem of the game. When you write a function, the only thing the caller should care about is: when I give input, I get reasonable output. The caller should never care what happens between the call and the return. Similarly, if I call the API of a subsystem of a part of the application, the code that calls that API should not be dependent at all on how that subsystem works under the hood.

This architecture allows me to rewrite a function (as long as I don't change the method signature) without affecting the rest of the application. Similarly, I can rewrite a whole subsystem without rewriting the rest of the application that depends on it.

'''How much legacy code is left in the game (e.g. an approximate percentage of what's left)? Where is most of it located? '''

This is a hard question to answer. I don't know what % of the code is legacy. I know of some subsystems that we have rewritten, however. As an example, when we did the Summoner's Rift Update, we rewrote a large portion of the rendering engine to make the game run faster so people with less powerful machines would not be left out to dry when we pushed the update. We've also rewritten major parts of the UI code more than once over the years.