Classes: suggestions for improvement

Juan Ignacio Dopazo dopazo.juan at
Mon Jun 13 08:41:26 PDT 2011

On Mon, Jun 13, 2011 at 12:01 PM, Kam Kasravi <kamkasravi at> wrote:

> On Jun 13, 2011, at 1:55 AM, Axel Rauschmayer <axel at> wrote:
> Indeed a number of frameworks use 'initialize' for their 'ctor'. I imagine
> this has been
> heavily discussed within TC39, but perhaps some of the rational has not
> made es-discuss.
> It was posted somewhere... The rationale is that 'constructor' is already a
property of the prototype that points to the constructor function.

function Test() {}
(Test.prototype.constructor === Test) // true

It was chosen to replace 'new' because is correct under ES5.

 On Sun, Jun 12, 2011 at 10:17 PM, Brendan Eich <brendan at> wrote:

> I'm not sure classes should grow to have private class or prototype
> variables in Mark stripped things down to help get classes in. The
> one reason I come back to them: private methods for common subroutining are
> frequent in practice. So YAGNI doesn't work. One can always closure- or
> module-wrap by hand; that's the counterargument.
> /be
> I'm not sure that's a counterargument. The whole point of the classes
proposal is to simplify the use of a common pattern. Private methods for
subroutines are a very common use case.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list