A Precedent

David Bruant bruant.d at gmail.com
Sat Apr 13 04:07:56 PDT 2013


Le 13/04/2013 03:31, Andrea Giammarchi a écrit :
> Do you read internet where every developer calls __proto__ ugly ?
I do read the Internet [1]. I believe Brendan and all TC39 do too.
Let's be super careful when using 
"every"/"all"/"no"/"none"/"always"/"never" and other superlatives.

History happened in the following order:
1) Mobile was pretty much WebKit-based only (at least that's what some 
devs have taken it)
2) Relevant WebKit-based browsers all have __proto__
3) Content (like Zepto) started to make the assumption that web browsers 
do have __proto__.
4) Content (like Zepto) got popular and this created an incentive for IE 
to support __proto__ [2] (among other things I imagine)
5) Microsoft will certainly implement __proto__ no matter what. This is 
apparently confirmed by folks who studied the leaked IE11 [3]

The 5 points are facts (the last is an assumption, but a strong one). 
Now, given these facts, what are the choices left to TC39?
1) Ignore reality. Hopefully, we will all agree that this would be plain 
irresponsible.
2) Standardize __proto__


Andrea: I and probably everyone else is as frustrated as you are of 
__proto__ standardization. But the above 5-points history is what it is; 
sorry for the self-quote, but "Web technologies are ugly and there is no 
way back..." [4].
The only alternative to standardizing __proto__ is not standardizing it 
and it's a worse idea (because of interoperability issues that would 
arise). __proto__ is happening in ES6 not because people actively want 
it, but because it's better than any other alternatives.

As I've repeated multiple times on the list, a feature being part of the 
standard doesn't make it a legitimate feature that web developers should 
seek to use (to a large extent, Crockford with his "good parts" said the 
exact same thing).
I read not introducing setPrototypeOf *also* as a social/political move 
to say to devs "TC39 is aware __proto__ is an awful monster that we have 
to bring to the standard, but we do not consider it as a recommended 
feature". But the standard cannot document the history of features. It 
also is neutral on what should be used by devs.

It's up to us (JS devs), to decide which parts we promote and use and 
which parts we think are stupid in the language. It's not up to TC39 
(though obviously they have their opinions).

Feel free to contribute to ECMAScript Regrets :-) It seems like a more 
appropriate place to rant about __proto__ and why it should be avoided 
by devs than es-discuss.

David

[1] 
https://github.com/madrobby/zepto/blob/342d490e483997878886e07f7e73505929df6089/src/zepto.js#L136
[2] https://mail.mozilla.org/pipermail/es-discuss/2011-December/019083.html
[3] 
http://fremycompany.com/BG/2013/Internet-Explorer-11-rsquo-s-leaked-build-395/
[4] 
https://github.com/DavidBruant/ECMAScript-regrets#web-technologies-are-ugly-and-there-is-no-way-back


More information about the es-discuss mailing list