W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Numeric constants vs enumerated strings

From: Harald Alvestrand <harald@alvestrand.no>
Date: Wed, 15 Feb 2012 14:57:00 +0100
Message-ID: <4F3BB9AC.2000209@alvestrand.no>
To: public-script-coord@w3.org
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>, public-webapps@w3.org, public-html@w3.org
*This is a call for help from the WEBRTC working group.
We are defining a new API 
(http://dev.w3.org/2011/webrtc/editor/webrtc.html) <about:blank>which 
has a number of cases where it needs to use arguments, or expose state 
variables, that can take only a limited set of values.

Feedback from the WebIDL community has been strongly in favour of using 
strings, possibly in the form of the newly added WebIDL "enum" 
construct", for these arguments.
However, the developers we're targeting will also be using many other W3 
APIs.

It seems that JavaScript APIs that deal with data flows in some form 
mostly use numeric constants, for instance, XMLHttpRequest, the 
Websocket API, HTMLTrackElement for timed text tracks, HTMLMediaElement 
for <audio> and <video>, various File APIs, the Indexed Database API, 
they all use "readyState" and it's always a numeric value.

So - we're interested in the advice of the community: What should we do? 
Be consistent, or be forward-looking?

A clear answer, if it exists, seems to be beyond the WEBRTC chairs.

          Harald and Stefan, for the WEBRTC WG

(note: we set public-script-coord@w3.org as the "reply-to" address on 
this mail, in order to avoid having a multi-mailing-list discussion. But 
the subject is concerning also for webapps and HTML, and possibly 
others, so we wanted to make sure they know we're asking. Feel free to 
share with others if you feel they need to be brought into the discussion.)

*
Received on Wednesday, 15 February 2012 13:57:37 UTC

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