lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I do it like in the first option.

But I prefer doing this depending on the condition:

if reverse_condition then return end
call_my_routine()


2017-08-16 10:49 GMT+01:00 Dirk Laurie <dirk.laurie@gmail.com>:
Suppose your program has some very short actions in an if.

if condition then call_my_routine() else return end

Do you indent it as:

if condition then
   call_my_routine()
else
   return
end

or as

if condition
   then call_my_routine()
   else return
end
if condition
   then call_my_routine()
   else return
end

or not at all?



--
Etiene Dalcol

Software Engineer @ Red Badger 
Lua Space http://lua.space
LuaConf http://luaconf.com