Numeric constants vs enumerated strings

*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:31 UTC