Ideas on type hinting and named parameters

Mark S. Miller erights at
Tue Jun 9 15:44:57 UTC 2015

On Tue, Jun 9, 2015 at 8:30 AM, Luke Scott <luke at> wrote:

> It currently uses `=` to define properties. And there is some debate
> whether or not properties should be initialized in the constructor or be on
> the prototype.

There is no debate about whether per-instance state (of whatever form) can
be initialized in the constructor. Often, this needs to be initialized to
some value dependent on the values of the constructor parameters. Given
that we have no choice about supporting initialization in constructors, the
debate is *only* about whether we should also bother to support
initialization in the class body outside the constructor. IMO, no. Why add
a redundant and less expressive mechanism?

As for properties on the prototype, these are rarely enough motivated that
doing it imperatively after class initialization seems fine. I don't recall
anyone strongly advocating that we need syntactic support for properties on
the prototype, though perhaps I missed it.

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

More information about the es-discuss mailing list