Whether the code is good or not is closely tied to its age. A lot of the older code base is mostly unchanged and doesn't use things that came with Lua 5.1. There's also a lot of global lookup going on. I replicated the entire code for displaying the contents of quest reward frames and managed to cut the line count in half due to how inefficient it is. As features get added, it's not uncommon that they're spaghetti coded on top of old code, which makes things worse.
There's also a ton of weird stuff that's floating about because different developers have come and gone. For example, there's an entire OOP class abstraction layer which only seems to be used for tutorials.
Reusing code with side effects (affecting things outside the scope of the function) also has the consequence of spreading taint, so you should be careful anytime you want to reuse code.
__________________
Last edited by MunkDev : 01-17-18 at 09:58 AM.
|