So what does ace do well? What tasks does it automate that are tedious to code and manage myself?
I tend to use the Blizzard API for most things. I sometimes use AceEvent, but really the difference between that and a simple OnEvent handler is a few lines of code and a lookup table.
The primary reason I use Ace3 is for AceConfig. The ability to quickly add a GUI configuration dialog to a simple addon, without having to design all the frames by hand is a huge benefit.
For some ppl, creativity is reduced if you live in a confined environment, not exposed to the somewhat complex reality. But not being exposed to conformism also helps to think out of the box, providing innovative solutions.
Anyway, knowledge is power. (And power is always abused, but that's politic ;)).
Just trolling around :p
Personally, I find that when I have TOO MANY options, I tend to get all A.D.D. and not get anything done. It's when there are limitations to work within and around that I've done some of my most creative coding.
There's the old saying:
"In the mind of the novice there are many possibilities. In the mind of the master, there are few"
You can take that one of two ways:
1) That folks who have mastered something have the experience and in-depth understanding to see and/or avoid many of the pitfalls and dead-ends that will trip up and/or confuse a novice.
2) That folks who feel they have mastered something start to get inflexible and static, while folks who feel they have much to learn are open to any/all posibilities
Come to think of it, there's a third way:
Try always to use #1, and be self-aware, least you fall into #2
The reason I mention all this that for me (personal opinion here), Ace3 is more of the #1 approach than #2
NOT saying that I have mastered ANYTHING though... I just look at using Ace3 as a way to gain from the experience of those who have.
I started programming C about 10 years ago (I don't really remember when I was in the 5th grade - of course it was stupid stuff, but it was fun). So when I came into doing WoW addons, I already had programming experience (I'm currently in college for it). However, I was not at all familiar with Lua functions or the WoW API; so I hit the proverbial brick wall at first.
I had an Addon idea that I wanted to hit the ground running with, and didn't want to take the time to familiarize myself with the WoW API and such first. That's where Ace3 made things a lot simpler. The documentation isn't really full and detailed, but it was enough. And the fact that most of the functionality that I would've needed to research on my own was in one lib package made things easier.
When it comes to "reinventing the wheel." When I first got into add-on programming, I like to think of it as I just jumped on the bike with Ace3 as my training wheels. However, now that I'm getting more comfortable, I think I want to remove the training wheels. This is a matter of preference, as I don't feel I need the full functionality of the libs (even the modules I use), so I want to trim the fat in a sense. Plus, it'll be fun.
...snip...
This is a matter of preference, as I don't feel I need the full functionality of the libs (even the modules I use), so I want to trim the fat in a sense. Plus, it'll be fun.
I thought that one of the benefits of using Ace3 was that there wasn't a lot of "fat" since only the latest single version is loaded no matter how many addons include/specify Ace3. So while your addon may have a little extra "weight" in terms of including the Ace3 externals in your package, the only time you're actually "adding weight" to someone's WoW environment is if you're the ONLY addon using Ace3.
Not saying that your choice ("removing the training wheels") isn't valid though. It's a personal choice.
In the end, I think that it's the common, consistent interface that Ace3 provides that really appeals to me. I know that if I use the Ace3 libs properly in my addons, and WoW makes some huge changes to their underlying structure, that Ace3 will be promptly up-to-date, thus saving me a lot of debugging/troubleshooting. My theory is that those maintaining Ace3 know a heck of a lot more about the inner workings of the WoW API than I do, and are much more likely to have folks on the PTRs testing the changes out and generally being on top of things than I ever will.
Someone else already said it... Doing things directly in the WoW API feels very "hackish" in places, and Ace3 does a pretty good job of abstracting that.
(edit): of course, the final line in your post "Plus, it'll be fun" is actually a great answer. When I'm just trying to get things done, I want the minimum hassle, but there IS an appeal to the "brain teaser" aspect of plumbing the depths of WoW APIs inner workings.
Ah, I didn't know that only one copy of the latest version in the lib stays resident. I know Ace3 is like 99% fat free, but my trimming was more in the sense of: "Why have a 99% fat free meal, when you just need some 99% fat free dessert."
However, if Ace3 only keeps one running copy, me programming my own desserts would actually be adding more fat. Since Ace3 will likely be installed anyway from some other add-on.
I was thinking of it more along the lines of (if you compare it to C++) that Ace3 worked more like a added statically linked object, as opposed to an externally linked library. And I thought that object got recompiled for each add-on that included it. Often I make a lot of assumptions, and they're usually wrong, haha.
Still, trying to learn some of it on my own will be fun. And I think it's usually beneficial to have a decent - if not intimate - knowledge of the inner workings of the API. Even if you're going to abstract it with something like Ace3, knowing what Ace3 is actually wrapping sometimes helps you use the library more effectively.
But usually in the end it just comes down to preference. The difference between using the library and writing your own functions - if you do it right - probably may only be a small difference in memory usage and CPU time.
All i can really say about Ace3... it's event dispatcher is SLOW! :P
slow being relative at that :P its a couple more table lookup i think which means you still may get the event a couple 1/10000 of a sec slower (speed will depend on your computer)
if you want a "fast" dispatcher then create your own which is simple enough
I was thinking of it more along the lines of (if you compare it to C++) that Ace3 worked more like a added statically linked object, as opposed to an externally linked library. And I thought that object got recompiled for each add-on that included it. Often I make a lot of assumptions, and they're usually wrong, haha.
You are not wrong. Every copy of Ace3 in every addon that includes it does get compiled and loaded into memory. So if you have 10 copies of Ace3 in 10 addons, 10 copies of Ace3 does get compiled and executed into memory.
What happens is that the code in every copy of the library, when executed, checks for an existing copy of the same library in memory. If one doesn't exist, continue to initialize. If one already exists, check its version. If it is older, overwrite it. If it is newer, stop initializing and do not overwrite the existing copy.
There will thus be 10 copies of Ace3 in memory, 9 of which gets garbage collected when all addons have finished loading, because all addons will no longer reference the 9 overwritten or discarded copies. (Library authors thus need to be extremely careful with the library upgrade code to ensure no memory leaks, and that function references are properly overwritten.)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I tend to use the Blizzard API for most things. I sometimes use AceEvent, but really the difference between that and a simple OnEvent handler is a few lines of code and a lookup table.
The primary reason I use Ace3 is for AceConfig. The ability to quickly add a GUI configuration dialog to a simple addon, without having to design all the frames by hand is a huge benefit.
Personally, I find that when I have TOO MANY options, I tend to get all A.D.D. and not get anything done. It's when there are limitations to work within and around that I've done some of my most creative coding.
There's the old saying:
"In the mind of the novice there are many possibilities. In the mind of the master, there are few"
You can take that one of two ways:
1) That folks who have mastered something have the experience and in-depth understanding to see and/or avoid many of the pitfalls and dead-ends that will trip up and/or confuse a novice.
2) That folks who feel they have mastered something start to get inflexible and static, while folks who feel they have much to learn are open to any/all posibilities
Come to think of it, there's a third way:
Try always to use #1, and be self-aware, least you fall into #2
The reason I mention all this that for me (personal opinion here), Ace3 is more of the #1 approach than #2
NOT saying that I have mastered ANYTHING though... I just look at using Ace3 as a way to gain from the experience of those who have.
I had an Addon idea that I wanted to hit the ground running with, and didn't want to take the time to familiarize myself with the WoW API and such first. That's where Ace3 made things a lot simpler. The documentation isn't really full and detailed, but it was enough. And the fact that most of the functionality that I would've needed to research on my own was in one lib package made things easier.
When it comes to "reinventing the wheel." When I first got into add-on programming, I like to think of it as I just jumped on the bike with Ace3 as my training wheels. However, now that I'm getting more comfortable, I think I want to remove the training wheels. This is a matter of preference, as I don't feel I need the full functionality of the libs (even the modules I use), so I want to trim the fat in a sense. Plus, it'll be fun.
I thought that one of the benefits of using Ace3 was that there wasn't a lot of "fat" since only the latest single version is loaded no matter how many addons include/specify Ace3. So while your addon may have a little extra "weight" in terms of including the Ace3 externals in your package, the only time you're actually "adding weight" to someone's WoW environment is if you're the ONLY addon using Ace3.
Not saying that your choice ("removing the training wheels") isn't valid though. It's a personal choice.
In the end, I think that it's the common, consistent interface that Ace3 provides that really appeals to me. I know that if I use the Ace3 libs properly in my addons, and WoW makes some huge changes to their underlying structure, that Ace3 will be promptly up-to-date, thus saving me a lot of debugging/troubleshooting. My theory is that those maintaining Ace3 know a heck of a lot more about the inner workings of the WoW API than I do, and are much more likely to have folks on the PTRs testing the changes out and generally being on top of things than I ever will.
Someone else already said it... Doing things directly in the WoW API feels very "hackish" in places, and Ace3 does a pretty good job of abstracting that.
(edit): of course, the final line in your post "Plus, it'll be fun" is actually a great answer. When I'm just trying to get things done, I want the minimum hassle, but there IS an appeal to the "brain teaser" aspect of plumbing the depths of WoW APIs inner workings.
However, if Ace3 only keeps one running copy, me programming my own desserts would actually be adding more fat. Since Ace3 will likely be installed anyway from some other add-on.
I was thinking of it more along the lines of (if you compare it to C++) that Ace3 worked more like a added statically linked object, as opposed to an externally linked library. And I thought that object got recompiled for each add-on that included it. Often I make a lot of assumptions, and they're usually wrong, haha.
Still, trying to learn some of it on my own will be fun. And I think it's usually beneficial to have a decent - if not intimate - knowledge of the inner workings of the API. Even if you're going to abstract it with something like Ace3, knowing what Ace3 is actually wrapping sometimes helps you use the library more effectively.
But usually in the end it just comes down to preference. The difference between using the library and writing your own functions - if you do it right - probably may only be a small difference in memory usage and CPU time.
slow being relative at that :P its a couple more table lookup i think which means you still may get the event a couple 1/10000 of a sec slower (speed will depend on your computer)
if you want a "fast" dispatcher then create your own which is simple enough
You are not wrong. Every copy of Ace3 in every addon that includes it does get compiled and loaded into memory. So if you have 10 copies of Ace3 in 10 addons, 10 copies of Ace3 does get compiled and executed into memory.
What happens is that the code in every copy of the library, when executed, checks for an existing copy of the same library in memory. If one doesn't exist, continue to initialize. If one already exists, check its version. If it is older, overwrite it. If it is newer, stop initializing and do not overwrite the existing copy.
There will thus be 10 copies of Ace3 in memory, 9 of which gets garbage collected when all addons have finished loading, because all addons will no longer reference the 9 overwritten or discarded copies. (Library authors thus need to be extremely careful with the library upgrade code to ensure no memory leaks, and that function references are properly overwritten.)