W3C home > Mailing lists > Public > public-sysapps@w3.org > May 2013

Re: Showing APIs to the ECMAScript world

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Thu, 09 May 2013 16:15:22 +0100
Message-ID: <518BBD8A.9090807@lamouri.fr>
To: public-sysapps@w3.org
On 09/05/13 14:29, Micheil Smith wrote:
> Hey all,
> 
> Small question: why is the "ignoreTimezone" / "respectTimezone" flag a
> string? 
> 
> Why not just use a Boolean in the signature, such as:
> 
> Future <http://web-alarms.sysapps.org/#future> add <http://web-alarms.sysapps.org/#alarmmanager-add>(Date date, optional any data, optional Boolean respectTimezones);
> 
> 
> Where by, if omitted, respectTimezones defaults to False.

The reason is that this attribute is pretty hard to understand and it
would be pretty easy to end up copy-pasting code and not really care
about that boolean being true or false. If it is a plain string, we hope
that developers might have at least a hint about the usage of this
argument. This is basically to make the method self-documented.

Cheers,
--
Mounir
Received on Thursday, 9 May 2013 15:15:46 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 1 July 2021 16:04:43 UTC