lua-users home
lua-l archive

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


Alen Ladavac wrote:
Really, this has more to embedded scripting in general than with C. I'm confident that everyone perfectly understand the concept of 0=false, 1=true, and that it is natural for that to be used in configuration scripts and similar.

Not really, for me, it is pure convention, used in C, and therefore in many other languages created by C programmers...
Java doesn't use this convention...
It could have been: a single digit is false, above 9 it is true...
The 0/1=false/true became a quite common convention, that's probably what you mean, but it is not "that" natural... :-)

In all our previous projects, both in-game console commands and configuration scripts support a notion of booleans as 0/1. People are used to type some_config_var=1 or =0. If =0 started to _enable_ stuff, we'd have a lot to explain to the users. Duck-and-cover kind of explaining. ;)

Is it so hard to test:
if some_config_var = 0 then
instead of just:
if not some_config_var then
?

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --