This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16938 - Change numeric constants to enumerated strings
Summary: Change numeric constants to enumerated strings
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Adrian Bateman [MSFT]
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-04 22:40 UTC by Odin Hørthe Omdal
Modified: 2012-07-17 21:55 UTC (History)
5 users (show)

See Also:


Attachments

Description Odin Hørthe Omdal 2012-05-04 22:40:44 UTC
From looking around at code on the internet, numeric constants are not really used at all. They don't fit very well into javascript, as it is not typed, so it's easier and shorter to just write the constant (1) instead of the (node.MY_CONSTANT).

IndexedDB recently made the change to a enum of strings.

http://lists.w3.org/Archives/Public/public-webapps/2012JanMar/thread.html#msg814

The disadvantage is that numeric constants are sadly used elsewhere. So it's more consistent continue as they are now. However, using enumerated strings will make the code much more readable and obvious.
Comment 1 Aaron Colwell (c) 2012-07-17 21:55:14 UTC
The numeric constants were removed during the conversion to the object-oriented API(https://www.w3.org/Bugs/Public/show_bug.cgi?id=17082). Strings are used now.