Re: A proposal for parameter style

On Wed, Apr 28, 2010 at 5:55 AM, Robin Berjon <robin@robineko.com> wrote:
> On Apr 28, 2010, at 12:04 , Anselm R Garbe wrote:
>>> WDYT?
>>
>> I agree with Andrei. Can't see why your current situation is more complex.
>
> Throughout the stack there is greater variety than if we were considering the design of a single API (just because each API is independent doesn't mean we shouldn't look at the ecosystem, and more specifically at how hard it would be for someone to learn all of them).

If you're going to look at the whole ecosystem, you also have to
include the other APIs that already exist in user agents that will be
implementing these new ones.  The first thing that stands out is that
they're not terribly consistent.  The second is that your new proposal
is quite different from most of what's there.

I think it's a mistake to say that callbacks should always be first if
some of them are likely to be optional, but I favor even that over
forcing all APIs to wrap their parameters in an extra object.  It
feels cumbersome, and removes even the minimal help that JavaScript
gives you with parameter passing [positionality]--if you misspell your
parameter, it's now null.

     Eric

Received on Wednesday, 28 April 2010 16:39:40 UTC