View Single Post
11-06-10, 05:24 PM   #21
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,334
I always defined "lightweight" or "simple" in comparison to the size of the codebase, the number of methods it employs to perform its task, and how "clean" the code is. In some part, it has a connection to functionality and efficiency.

The codebase size refers roughly to the number of lines an addon takes up if written in an easily readable fashion. The number of methods used refers to subgroups of code that handle different tasks to achieve the final goal. "Clean" refers to how direct the code is to accomplishing its task. This is a direct correlation to efficiency and the ease of how the code flows. "Dirty" code such as hacks or workarounds to fix a glitch, either in the AddOn or the WoW API, would count against this in variation to how complex it is.

For example, an anti-duel addon that prevents a duel request from showing up on screen and autodeclines it that takes up only 4-6 lines of code would be considered "lightweight" to me.

My addon, Cooldown Watch, has a short codebase (47 lines), uses only a few methods to get the job done, but one of those methods uses a hack through an undocumented effect considering the metatables of frames of the same type. Even with the mark down in "cleanliness", it still performs admirably in the other areas and would get my decision as "lightweight".

Another example to go through would be my joke addon for Cataclysm Beta, Benny Hill Worgen. The codebase is fairly small (65 lines), but it has many methods to ensure it runs properly. It has a registered slash command to toggle on/off and saves its state across sessions. It watches the combat log for a specific buff application and fade along with instant and delayed handling of transformations. It also counters a glitch with the game client stopping music playback immediately after loading a new area. The two workarounds for problems with the WoW environment count against the "clean" code requirement as well. Even though it has a small codebase, I would NOT consider this "lightweight".
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote