Re: Syntax of new constraint proposal

On Mon, May 19, 2014 at 4:31 AM, Cullen Jennings (fluffy)
<fluffy@cisco.com> wrote:
>
> On May 18, 2014, at 1:21 PM, Justin Uberti <juberti@google.com> wrote:
>
>> I think 'ideal' will make this less inscrutable, e.g.
>>
>> videoCfg = {
>>  require: ["width"],
>>  width: { min: 640, ideal: 1920 },
>> };
>>
>> which to me reads even more cleanly that the mandatory/optional syntax.
>>
>
> yah, that is even clearer - but the require things is still confusing. What about
>
> videoCfg = [
>     { constrain: ”width”, min: 640, ideal: 1920 },
> ];


Or to express the same semantics as the first example, maybe:
videoCfg = [
    { constrain: ”width”, min: 640, ideal-min: 1920, ideal-max: 2560 },
];

TBH I really quite like this. It turns the constraining around from
listing the attributes, then listing the requirements, then the
optional (but preferred ones) to grouping all information together by
constraint feature.

Silvia.

Received on Monday, 19 May 2014 00:14:21 UTC