View Single Post
01-06-19, 07:51 PM   #8
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Originally Posted by FranekW View Post
Do you always define the main addon object as local?
I do, yes. Otherwise the object is in the global name space, which is bad more often than getting away with it, and it is never good.

The name HiddenFrames is incredibly generic, and 99.99% likely to be overwritten with code that isn't yours. Even if you did have a totally unique name, making variables local is almost always better.

With Ace3, you can use AceAddon's GetAddon API to return the object if it is in another file within the same addon, meaning if the primary file defines the object as local, you can still reference it in another file.
  Reply With Quote