View Single Post
09-19-16, 02:46 AM   #8
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Always nice to see tutorial code, but gah, guys! Where are the spaces? Let it breathe, as it adds readability. I know it is user preference, but really!
Lua Code:
  1. local tostring=tostring -- ouch on the brain and eyes
  2. local tostring = tostring -- ah, much better
  3.  
  4. -- which of these looks better?
  5. for i=1,select("#",...) do msg=(msg~="" and msg.." " or "")..tostring(select(i,...)); end
  6.  
  7. for i = 1, select("#", ...) do msg = (msg ~= "" and msg .." " or "") .. tostring(select(i, ...)); end
  8.  
  9. for i = 1, select("#", ...) do
  10.     msg = (msg ~= "" and msg .." " or "") ..tostring(select(i ,...));
  11. end
  Reply With Quote