View Single Post
10-08-15, 02:06 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Nikita S. Doroshenko View Post
But even when i see Blizzard's code (who could think, it's one of the top game company in a world, and most known company), and their interface code looks messy in some files, and style of code different, and looks like that they don't even have a code standard, I find this very strange.
Don't use Blizzard's code as an example of anything other than basic API usage (eg. what values are returned by what functions). It is indeed messy and inconsistent, and often is not just stylistically bad, but functionally bad as well. It's full of unnecessary globals, excess table and function creations, and other unsavory habits. There are also plenty of examples to be found in there of code written by someone who clearly was not familiar with Lua at all... this is my all-time favorite right here:

https://www.townlong-yak.com/framexm...arent.lua#3627

Whoever wrote that apparently did not know about string.upper.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote