Classes: suggestions for improvement

Bob Nystrom rnystrom at google.com
Tue Jun 14 13:46:07 PDT 2011


On Tue, Jun 14, 2011 at 1:34 PM, felix <felix8a at gmail.com> wrote:

> > I think that's been considered before. My complaint with it is that Point
> > isn't a prototype. It's a constructor function whose .prototype property
> is
> > the prototype. In other words, the object bound to the name Point isn't
> the
> > prototypical point. It's a constructor/class-thing/type-object kind of
> > thing. It owns the Point prototype, but isn't it itself.
>
> Hm, by that argument "class" isn't a particularly good term either,
> since the thing created is not a class, it's a thing that generates
> objects that can be considered instances of a class.


That's actually a pretty close definition of a class in other dynamic
languages. In Smalltalk, Ruby, and Python, classes are objects that have
methods to let you create instances of themselves.

- bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110614/0724e349/attachment.html>


More information about the es-discuss mailing list