View Single Post
08-25-14, 05:22 PM   #20
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Sharparam View Post
One reason could be if you make something that you want to behave like a Frame's event/script system.
So... either use the normal Frame event/script system, or name your method something else? Still not seeing how this is leading to using a default API method name for your own custom method is in any way beneficial, regardless of whether you're defining it on a Frame object or a plain table. If I see "object:SetScript" in WoW addon code, the only reasonable assumption to make is that "object" is a frame of some type, and "SetScript" is the standard "SetScript" method that comes with a frame object.

Originally Posted by Sharparam View Post
And if you're just blindly using a Frame to put all your methods in, you could be unknowingly replacing something that the Frame actually uses for whatever purpose if you don't check the documentation before implementing a method.
If you have no idea what methods a Frame object comes with, you should take your hands off the keyboard and go look at some API documentation before proceeding.

Originally Posted by Sharparam View Post
An example being in the options file of one of my addons (code is in MoonScript, but should be relatively readable I hope).
Ugh, MoonScript. Someone (maybe you) posted a link to that recently, and the official examples of Lua code it generates about made me vomit. It's horrible.... but I guess if you're not actually programming in Lua, and you're writing your addons in some Python-like pseudo-code that generates Lua code on par with the HTML generated by MS Front Page circa 1997, that probably explains why you're arguing in favor or something that makes no sense.
__________________
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