W3C home > Mailing lists > Public > public-media-capture@w3.org > May 2012

Re: Syntax options for constraints structure

From: Anant Narayanan <anant@mozilla.com>
Date: Thu, 10 May 2012 12:01:15 -0700
Message-ID: <4FAC107B.3080801@mozilla.com>
To: public-media-capture@w3.org
Paul,

On 5/10/12 11:31 AM, Paul Neave wrote:
> Firstly, why are there so many arrays and objects created? And why is an array [] used at all? It's bizarre!
...
> In my view, this could be much more simplified like so:
...
> There's no need to wrap each and every attribute in its own object {} parentheses, and no need to use an array at all.

For the optional constraints, order matters, therefore it is necessary 
to use an array. Once we need an array, each constraint needs to be it's 
own object or we can't use keys.

I agree that it feels a little verbose but unfortunately, JS doesn't 
provide the primitives to achieve what we really want (dictionaries with 
ordered keys).

-Anant
Received on Thursday, 10 May 2012 19:01:44 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:14:59 GMT