Summary of advice, numeric constants vs enumerated strings

OK, now the traffic seems to have died down, and I'll attempt to 
summarize opinions stated.
I may have missed some; I only looked at posts with "numeric" in the 
subject across the mailing lists I CCed the original message to, which 
were dated after my original request for advice. (Note: using reply-to 
to indicate where to continue discussion was a total failure.)

Points raised during the debate:
- the current deployed base is inconsistent; in particular 
'document.readyState' is already a string
- the WebSockeet API mixes both approaches
- the amount of JS code that uses numeric constants today is 
microscopic, even when they are defined
- the pattern "set attribute to value, check if it has retained the 
value to verify if it's understood" is already common in JS attribute APIs

The question has also caused the same issue to be raised in the context 
of IndexedDB over in WebApps - a spec that is currently far more stable 
than the PeerConnection API is.

This was not a request for a vote, but in order to make sure I reflect 
people's opinions correctly, here are the commenters' names:

STRONGLY IN FAVOUR OF ENUMERATED STRINGS ONLY
- Anne van Kesteren
- Tobie Langel
- Marcos Caceres
- Alex Russell
- Tab Atkins

STRONGLY IN FAVOUR OF NUMERIC CONSTANTS ONLY
Nobody!

IN FAVOUR OF SOME KIND OF MIXED APPROACH
(for instance keeping readyState numeric, but let other integer-constant 
sets go to strings)

- Dominique Hazaël-Massieux (regards consistency with current numeric 
interfaces as important)
- Philip Jägenstedt (suggests magic objects that compare equal to both 
numbers and strings)

NOT SURE WHERE TO PLACE THEM
(people who contributed on the thread, but did not make a clear 
statement one way or the other in their postings on this thread)
- Travis Leithead
- Timothy Terriberry

My conclusion from this round of asking for advice is that the summary 
of the advice given is that we SHOULD make the change, and revise the 
spec to use strings in all places where integer constants are used today.

People who feel that they were misrepresented in the above tabulation, 
or who wish to have their names associated with one or more of the 
groups, please speak up ASAP!

                         Harald

Received on Wednesday, 29 February 2012 12:54:12 UTC