Originally Posted by myrroddin
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:
local tostring=tostring -- ouch on the brain and eyes local tostring = tostring -- ah, much better -- which of these looks better? for i=1,select("#",...) do msg=(msg~="" and msg.." " or "")..tostring(select(i,...)); end for i = 1, select("#", ...) do msg = (msg ~= "" and msg .." " or "") .. tostring(select(i, ...)); end for i = 1, select("#", ...) do msg = (msg ~= "" and msg .." " or "") ..tostring(select(i ,...)); end
|
It's personal preference. This looks better to me:
Lua Code:
for i=1,select('#',...) do
msg=(msg~='' and msg..' ' or '')..tostring(select(i,...))
end
I only use spaces when absolutely necessary, and sometimes I don't even use returns. I usually just put a block onto one line if it's shorter than ~100 characters, but it depends on how it looks around other code.
Also, I refuse to use semicolons and unless I'm expecting apostrophes, I'll use single quotes.