Re: Dictionary-shaped Hammers

On 09/12/2013 5:02 PM, Martin Thomson wrote:
> On 9 December 2013 13:44, cowwoc <cowwoc@bbs.darktech.org> wrote:
>> Who throw an error on unknown constraints? ConstraintSet.set() or
>> getUserMedia()? I'd prefer the former (fail as early as possible) but I'm
>> curious what you were thinking.
> You don't get the former sadly.  Since ConstraintSet is generic (you
> can see this from its name), it can't know where it is going to be
> applied until it actually is applied.
>
>> How do we support forward-compatibility? I didn't see you mention a
>> getSupportedConstraints() method or something similar.
> I imagine that having an exception thrown is a good way to learn that
> something is not supported.  That's less necessary with this.  That
> said, I'm not against it either.  It's not quite interface cruft.

I'm +1 for this proposal if you add getSupportedConstraints().

The general consensus seems to be that exceptions shouldn't be used to 
drive normal program flow: http://stackoverflow.com/q/729379/14731
"Exceptions are reserved for exceptional cases." :)

Gili

Received on Monday, 9 December 2013 23:21:46 UTC