- From: Alex Russell <slightlyoff@google.com>
- Date: Wed, 15 Feb 2012 17:37:30 +0000
- To: Marcos Caceres <w3c@marcosc.com>
- Cc: Dominique Hazael-Massieux <dom@w3.org>, Anne van Kesteren <annevk@opera.com>, public-script-coord@w3.org, Harald Alvestrand <harald@alvestrand.no>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On Wed, Feb 15, 2012 at 5:28 PM, Marcos Caceres <w3c@marcosc.com> wrote: > > > > On Wednesday, February 15, 2012 at 5:16 PM, Dominique Hazael-Massieux wrote: > >> (trimming cc as originally requested) >> >> Le mercredi 15 février 2012 à 17:05 +0000, Marcos Caceres a écrit : >> > > There are strong ties, in the sense that the said API would be exposing >> > > a readyState property (similar to XMLHttpRequest, HTMLMedia, etc). >> > >> > >> > >> > I'm not sure there is any relationship to the internal state of an >> > object and using object.SOME_HARD_TO_REMEMBER_AND_TYPE_THING… >> > specially when you can just type "thing". >> >> >> >> That's not the point; the point is that if we use strings for a >> readyState property in one API, and numeric values in many others, we >> would have scripts that have code that looks like: >> >> if (XHR.readyState == 4) { >> >> } >> if (P2P.readyState == "done") { >> >> } >> >> That seems utterly confusing, hard to remember, hard to teach, etc. > > Not to me (or those working on WebIDL, hence the warning in the spec): "done" makes more sense than "4". > > Here is a real example of how ridiculously stupid the use of constants can get: > > var msg = deviceapis.messaging.createMessage(deviceapis.messaging.TYPE_SMS); > > Um… compared to: > > var msg = deviceapis.messaging.createMessage("sms"); > > Nuff said. +1
Received on Wednesday, 15 February 2012 17:38:31 UTC