Re: Showing APIs to the ECMAScript world

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