W3C home > Mailing lists > Public > public-device-apis@w3.org > April 2010

Re: A proposal for parameter style

From: Robin Berjon <robin@robineko.com>
Date: Wed, 28 Apr 2010 18:24:22 +0200
Cc: public-device-apis@w3.org
Message-Id: <B1FEA7CF-C611-496F-829A-F25345CD5A1A@robineko.com>
To: Anselm R Garbe <garbeam@gmail.com>
On Apr 28, 2010, at 15:01 , Anselm R Garbe wrote:
> One idea I proposed originally in BONDI was having all callbacks at
> the end of functions:
> 
> void func(options, [successCB, [errorCB]]);
> 
> The advantage would have been that an implementation would have been
> able to react sync or async depending of the arguments passed in (eg
> if no CBs passed in, it could have done the operation synchronously).

I like the DWIM nature of it :) But on the downside it requires to pass null or {} when there are no options, and I have a feeling that using it to decide on the synchronicity of the call is perhaps a little too smart. Also, we don't want all calls to be usable synchronously!

--
Robin Berjon
  robineko  hired gun, higher standards
  http://robineko.com/
Received on Wednesday, 28 April 2010 16:24:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:43 UTC