Re: Using enums to avoid default true in "settings dictionaries" (#466, #467, #471)

On 17 February 2016 at 19:50, Jan-Ivar Bruaroey <jib@mozilla.com> wrote:
> So the only difference here would appear to be mental: In that, undefined,
> being falsy, is arguably a valid input to a boolean, i.e. users might
> reasonably expect undefined to produce false, not true, and they would be
> right.


The problem is when you have:

dictionary Foo {
  boolean bar = true;
};

That is the discouraged pattern.  Because undefined is converted to
true in direct violation of the usual truthy/falsy conversions
pattern.

Received on Saturday, 20 February 2016 00:52:24 UTC