Syntax of new constraint proposal

The old syntax looked something like 

videoCfg = {
 mandatory: 
    { width: { min: 640 } } 
 optional: [
    { width: { min: 1920 } }, 
    { width: { max: 2560 } } ]
}

It’s pretty easy to read that and guess what it means. 

The new syntax looks like 

videoCfg = {
 require: ["width"], 
 width: { min: 640 }, 
 advanced: [
    { width: { min: 1920 } }, 
    { width: { max: 2560 } } ]
};

I find that much more opaque when it comes to guessing what it does. I prefer the old syntax to the new proposal. I think we need some discussion on how to make this less confusing to developers. 

Received on Sunday, 18 May 2014 14:53:33 UTC