Use of both numbered constants and strings

Hi

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html says

[[
Some attributes taking constant values have changed during API review. The  
old way uses integer values, while the new way uses Web IDL string values.  
An implementation must support both integer and string values for setting  
these attributes:
// PannerNode constants for the .panningModel attribute

// Old way
const unsigned short EQUALPOWER = 0;
const unsigned short HRTF = 1;
const unsigned short SOUNDFIELD = 2;

// New way
enum PanningModelType {
   "equalpower",
   "HRTF",
   "soundfield"
};
]]

I'm not quite happy about the spec supporting both the legacy way and the  
new way. AFAIK no other API supports both. In HTML, for APIs that are  
widely used and thus can't have the numbered constants removed, the API  
only supports the legacy constants (can't come up with an example right  
now). For APIs that are not widely used yet and thus can be changed in  
incompatible ways, the APIs were changed to only support the strings (e.g.  
TextTrack.mode).

Is Web Audio API widely used? Please consider choosing between "old way"  
and "new way". I think supporting both will be confusing for authors.

-- 
Simon Pieters
Opera Software

Received on Monday, 15 April 2013 17:37:12 UTC