Minimalist (why) classes ?

David Ziegler dz at mudchicken.com
Mon Nov 14 13:54:59 PST 2011


On Fri, Nov 11, 2011 at 7:31 PM, Brendan Eich <brendan at mozilla.com> wrote:
> Class syntax is wanted to avoid some method calling boilerplate that's more
> verbose, arguably easier to get wrong, and harder to analyze and optimize.
> That's it.
> Hence, "classes as sugar". If you find existing JS sweet enough, you won't
> want classes.
> /be

I believe that the biggest advantage of a standard "blessed" way of
declaring classes would be that it would become much easier to read
each others code.

For example: an experienced Java developer has spent thousands of
hours staring at code that follows a standardized top-level pattern,
and they have built up the specialized neural machinery that allows
them to (for example) grok the top level structure of a class at a
glance.  (In much the same way that an expert chess player can see in
a glance what a less experienced player would have to work out over
minutes - or would never see at all).

In current JS practice, almost every program uses a different way of
defining the top level structures such as modules, classes, methods
and so on - in an important sense every JS program is written in a
somewhat different language, and is alien to everyone but it's author.

- Regards

David Ziegler
dz at mudchicken.com


More information about the es-discuss mailing list