View Single Post
12-30-14, 06:29 AM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If I'm writing a simple "delay for ADDON_LOADED or PLAYER_LOGIN" frame that only handles that one event by design, I would never add an event check, since it's blatantly obvious that the frame is only handling one event and will only ever handle one event. Adding an event check in this type of code just wastes (imaginary) CPU time and adds useless clutter. I'd argue that the clutter aspect actually makes your code harder to maintain, since when you come back and look at it and see an event check, you assume it must be able to handle other events, and then are confused as to why the hell you included an event check on a frame that only handles one event.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote