View Single Post
09-27-13, 03:17 PM   #30
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by Resike View Post
I rather use xml for addon options then lua. If blizzard uses it too then why shoudn't we?
Blizzard's code is full of horrible implementation so citing it as a basis for doing something isn't really the way to go.

Some negatives of using XML:
1. Global variables must be used either for object names or inherited functions.
2. Directly coding a script handler in an XML template will result in separate copies of each function rather than one copy shared between the all objects.
3. Most code I've seen ends up with wasted functions for script handlers, a function that does nothing but call another function. This is a waste of memory and processing time, no matter how small a waste it is.

Some positive of using Lua:
1. A Lua factory function can be garbage-collected, an XML template cannot.
2. No need for an OnLoad script.
3. You can pass arguments to really customize the creation process.
  Reply With Quote