View Single Post
12-30-14, 06:03 AM   #13
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
Just my 2 cents: I think it is a good practice to always check the event even if you just have one registered, always doing this will make maintaining your code easier. You will just need to add lines, same about event handler, sometimes you don't need to use the parameters and could just
f:SetScript("OnEvent", function()
but if you always declare
f:SetScript("OnEvent", function(self, event, ...)
you made your code more generic and easier to maintain.
Scripted language main point is to descriptive, being a performance freak in scripted languages does you no good when that makes your code harder to read and maintain. Of course that is no excuse to poor coding though.

Last edited by Banknorris : 12-30-14 at 01:42 PM.
  Reply With Quote