New private names proposal
Brendan Eich
brendan at mozilla.com
Tue Dec 21 22:40:59 PST 2010
On Dec 21, 2010, at 10:17 PM, Alex Russell wrote:
> On Dec 21, 2010, at 10:14 PM, Brendan Eich wrote:
>
> I fear APIs that freeze, only take frozen objects or only have versions that do, or are so mutability-hostile that they warp our use of the language toward frozen-by-default constructs. Those are the sorts of things that spread it.
Spread it how, pray tell?
Putting Object.create/freeze/etc. in ES5 (let's leave aside the API design errors that people debate) does not create a wolf in the fold, or a runaway water crystallization threat. No coercive entity forces developers to use any of the freezy bits here.
You think TC39 will make APIs that only work with frozen objects? Or HTML5 or Web Apps in the w3c? There's no evidence for this fear, no obvious way these APIs could be deployed in a mixed-browser version market, and plenty of evidence that developers -- both web and browser -- would reject such attempts. I know a bunch of us at Mozilla would.
I think we've gone way off the technical beam here. There are valid uses for immutability, in building systems that have safety and parallelization properties. That's a fact. We're not going to reject freeze from JS just out of fear that someone might become Dr. Freeze. If that happens, call Batman. Better: be Batman.
/be
More information about the es-discuss
mailing list