W3C home > Mailing lists > Public > public-media-capture@w3.org > February 2016

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

From: Martin Thomson <martin.thomson@gmail.com>
Date: Thu, 18 Feb 2016 06:51:12 +1100
Message-ID: <CABkgnnWjE2CVcQnis=-jkEP19svJ2qi=km+vxJSqCRxF4Zy6ig@mail.gmail.com>
To: Peter Thatcher <pthatcher@google.com>
Cc: Harald Alvestrand <harald@alvestrand.no>, "public-media-capture@w3.org" <public-media-capture@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 17 February 2016 19:51:44 UTC