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

Re: CfC: The Media Capture API FPWD

From: Robin Berjon <robin@robineko.com>
Date: Tue, 7 Sep 2010 14:49:08 +0100
Cc: public-device-apis@w3.org
Message-Id: <A9E77262-6386-4329-A9AE-038F93772F02@robineko.com>
To: Ilkka Oksanen <Ilkka.Oksanen@nokia.com>
On Sep 2, 2010, at 13:37 , Ilkka Oksanen wrote:
>> 4. I never understood the difference between nullable and optional. 
>> In Contacts everything that is optional is also nullable. I don't
>> see why not (?)
> I might be wrong but isn't the difference that JavaScript function calls
> example(1, 2) and example(1) are legal and example(1, null) is not if the
> second integer parameter is optional but not nullable. Is there then any
> benefit to allow the null case?  I'm fine to align Capture API with
> Contacts if it is more complex than this.

Right. The distinction can be useful when you don't want to pass a given parameter but do want to pass the one after it. In that case you need null: foo.bar(1, null, 2). But it's true that it's confusing and messy in general.

It has a stronger impact on Java, but I don't believe anyone cares that much.

Robin Berjon
  robineko  hired gun, higher standards
Received on Tuesday, 7 September 2010 13:49:58 UTC

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