Re: Syntax options for constraints structure

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 UTC