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

On 18 February 2016 at 03:50, Peter Thatcher <pthatcher@google.com> wrote:
> I'm left wondering: if it's just "bad WebIDL form" to have true-ish
> defaults, why don't we just leave the defaults "undefined" and make the
> meaning of "undefined" on dictionaries, when passed in their respective
> methods, be "ordered data channel", "sender is active", "receiver is
> active", and "VAD is enabled"?  Wouldn't that be a lot more simple?


That would be adherance to the letter of the law, but spitting on the
spirit of it.  This guidance exists for a reason.

I agree that these are somewhat tricky.  These are features that we
have agreed need certain defaults.  If we weren't so reliant on
dictionary passing, we could leave no direct parameters for each of
them and do this:

sender.disableVoiceActivityDetection();

Or, if you want to get fancy, you could phrase disablement as a "feature":

{ sendSilence: true }

Received on Wednesday, 17 February 2016 19:51:44 UTC