W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2011

Re: [WebIDL] Remove string constants

From: James Graham <jgraham@opera.com>
Date: Thu, 20 Oct 2011 10:18:13 +0200
Message-ID: <4E9FD945.6070102@opera.com>
To: public-script-coord@w3.org
On 10/20/2011 07:26 AM, Jonas Sicking wrote:
> On Wed, Oct 19, 2011 at 7:25 PM, Anne van Kesteren<annevk@opera.com>  wrote:
>> Strings are intrinsically meaningful and therefore have no need for
>> constants in APIs for the platform. See XMLHttpRequest.responseType and the
>> <canvas>  2D API for examples. We should remove string constants so people
>> (e.g. public-web-perf) will not use them and introduce inconsistent APIs.
>>

> However, there still is an argument for the constant, which is that it
> enables feature detection.

The other argument is that they make it easier to implement an IDE with 
code completion. I don't know if this is enough to make up for the fact 
that they are long and ugly.

A third argument is that it is well known that constants are always 
uppercase so one doesn't need to remember whether it is "2d" or "2D".
Received on Thursday, 20 October 2011 08:18:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC