lua-users home
lua-l archive

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


On 2 August 2018 at 14:00, Axel Kittenberger <axkibe@gmail.com> wrote:
== true ...

I'll always cringe to that since beginners think an if _must_ have a comparison operator in it.

It is already boolean, no need to thest it again.

if process_the_data then
  slice_and_dice(data)
end


Better safe than sorry. process_the_data might return anything, anything other than false or nil will resolve as true. I prefer to avoid 'sort of true' in conditionals
 
Oh and this discussion is about removing not adding.

Oops my bad. Got sidetracked when Mark Balmer mentioned readability.