View Single Post
08-25-14, 02:50 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Sharparam View Post
IKeeping it separated in that way makes it more clear what code is yours and what code comes from default libraries, and can in some cases also make code more readable for an outside developer, they wouldn't have to check if the method someframe:SomeMethod() that is defined in file1.lua and used in file2.lua comes from the WoW Frame or a custom method in file1.lua.
But why are you giving your custom methods the same names as default methods in the first place? This is just as bad an idea as naming a table table or naming a local function tostring -- there's just no reason to do it. If you see a SetScript method in a WoW addon, it should always be the SetScript method that comes with the given object type, period, just like if you see a call to a function named tostring it should be the Lua language function. Anything else is just confusing for no reason.
__________________
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