Classes: suggestions for improvement

Brendan Eich brendan at
Sun Jun 12 15:54:37 PDT 2011

On Jun 12, 2011, at 3:49 PM, Axel Rauschmayer wrote:

>>> and the "static" keyword for defining class properties are welcome additions.
>> Why "static" is the wrong word: there is nothing compile-time about the class properties. Classes are expressible (anonymous, even), as well as declarable in nested (generative) ways.
>> Using "class" does not work if one wants nested classes, although the default that binds prototype properties for ExportableDefinitions including Declarations seems like exactly the wrong default: how often do you want class Outer { class Nested {} ... } to make Nested a property of Outer.prototype, instead of a class property (Outer.Nested)?
>> Again, the grammatical retasking of certain Declarations to bind prototype properties (instead of lexical bindings in the class body, or perhaps class properties -- but perhaps not) seems like a mistake.
> Terminology-wise, I have always avoided the word “class” in JavaScript and used the word “type”, instead (with, roughly, constructors implementing types). I call Properties such as Math.PI type variables. Then you can also talk about subtyping (instead of subclassing).

Sorry, I can't agree with this. "type" is even more of a loaded word, and a misnomer. Math is not even a constructor, never mind a type!


More information about the es-discuss mailing list