Thread: Addon Etiquette
View Single Post
04/20/14, 11:59 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
I am a music teacher by day, not a coder. Everything I have learned I have taught myself or picked up from other authors/addons, along with 7 or 8 years of writing addons for WoW.

Many people are like me. They aren't software engineers, they are teaching themselves because this is a hobby for them. Making them also learn standards/rules and adhere to them is going to be another layer you are putting on them for something that they are doing in their free time for fun.

That does not mean that I don't disagree with all of your ideas. But what you propose should come from convention, not rules. And conventions take time to develop, as more authors adopt them for their addons and more new authors learn from viewing those addons.

---------------

Let's talk about libraries first.

Placing libraries into a libs folder inside the addon folder is a convention brought over by authors from WoW. The addon loads and works just the same whether the folder is called libraries, StuffMyAddonNeedsToWork, or doesn't exist at all (with the libraries in the top level of the addon folder itself). To users, this doesn't matter at all. And to other authors, it shouldn't either.

Installing libraries as standalone and not including them in the main addon itself is not a good idea. Even over in WoW, it was discouraged and for those that wanted to install their addons this way, it was stressed that they should only do this if they were "power users" and "knew what they were doing". (Now, I do create my libraries so that they may be used as standalone if the user or author so chooses to install them this way, or the author may pull the actual library code's folder out to embed in their addon.) To users, standalone libraries give them a headache of worrying why an addon isn't working if they've accidentally disabled or uninstalled a library that they didn't know the addon uses. Also, to users, it either forces them to use Minion to install their addons or suffer the consequences of needing to make sure they have everything installed that they need. Really, addons should just work.

This brings me to my next point. I have ported LibStub over to ESO for the purpose of creating libraries that may be embedded. Any author that creates a library *should* use LibStub in their library. (But if they want to code this into their libraries themselves instead of use LibStub, whatever.) A library registers with LibStub as it loads. If you have 5 addons installed, for example, that all use LibAddonMenu-1.0, then all five instances of LAM make a call to LibStub, passing along their version numbers. LibStub only accepts the library with the most recent version number and discards the rest. What does this mean for a user? They may have 5 copies of LAM installed inside their addons, but only 1 is being used. What of the extra 60kb of memory on your hard drive from the other four? What does it really matter, if you have a 500GB hard drive?

----------------

Now, let's talk the settings menu.

I agree that the scroll menu should not get too long. From day 1, I've been saying that authors should condense their addons into one settings panel, if possible. I have been placing the settings from all of my ZAM addons into one panel as an example. This is easier to do if your addons follow a naming scheme, as mine do. Some authors choose to be more creative with their addons names or don't wish to brand them with a naming scheme. These authors, if they wish to condense their settings onto one panel, may be those who name their panel after their username. That doesn't mean that they're turning this into a popularity contest. It just means that they're saving users some room. And, so long as they tell users where to find their settings panel, what does it matter?

Now, here come conventions for certain circumstances.
  • If you addon has no settings, and you only want to put a description in your settings panel, don't create a panel for your addon.
  • If your addon only has one or two settings that could easily be done through slash commands instead, don't create a panel for your addon.
  • If the settings for your addon are complicated, or would have better usability if presented in a different format that LAM provides, don't create a panel for your addon. Create your own options GUI that users can open with a slash-command and/or keybind.

----------------

Next, let's discuss saved variables.

This is not anything that is enforceable across addons. I don't even use the ZOS API for creating saved variables. Instead, I do it with the much easier method that I use in WoW. You shouldn't force authors to follow a specific naming scheme for saved variables either. What if they want more than one saved variable? (Yes, I realize that saved variables can be a table, but some authors want two distinctly separate saved tables.) What if their addon is named My_Addon2, but they just want their saved variables named MyAddonDB? What if the only thing an author wants to save is whether or not the addon has been loaded for the first time already? Then their saved variable name may be MyAddonLoaded. To users, saved variable names do not matter. To other authors, saved variable names, do not matter. To Joviex's addon, and his addon only, they matter. A standard or convention should not be created for one use-case.

Instead, I keep saying that it should be up to the addon authors themselves to place profile support within their addons. If Joviex wants to write a library that makes that easier, they may adopt profile support faster. Me, if I make profiles in my addons, I'll just do it based on the same way I did it in the past with WoW. This is what I know, this is what I'm comfortable with, and this is something that works.

-----------------

Lastly, let's discuss formatting.

I use tabs myself. Others use spaces. Those that use spaces may vary from 2 to 4 to 5... It's all about personal preference. Tab size may vary from editor to editor, but spaces stay the same. This is not something that needs a "standard".

Semi-colons at the end of lines/commands are not necessary in Lua, yet some authors choose to include them from experience coding in other languages. Semi-colons don't hurt any, so it does't matter whether they're included or not. This is not something that needs a "standard".

Some authors choose to put in extra white space for readability and/or separation. So, it may add 1b to your file size, but it adds 0b to your addon's memory usage. Extra white space is not something that needs a "standard".
  Reply With Quote