excluding features from sloppy mode

Kevin Smith khs4473 at gmail.com
Sun Dec 30 20:37:12 PST 2012


This is a bit long - bear with me...

First, let me make one more argument as to why "new syntax, just use it"
won't work:

(a) In ES6, "let" is the preferred way to declare variables.  Let's not be
relativistic to the point of goo here.  Block-scoped variables are
"better".  As such, "let" is of central importance to the language.
(b) ES6 sloppy mode cannot have "let".
(c) Therefore, ES6 sloppy mode is a hobbled, incomplete version of the ES6
language, and
(d) Since ES6 sloppy mode is not the same as ES6, there can be no "1JS" as
long as ES6 sloppy mode exists.

Sure, you could attack (b) by using parsing tricks and special cases.  You
can make anything "work".  But then we're shirking the language designer's
responsibility of guarding the values of simplicity and elegance.

I take it that you agree in principle with strict mode.  If I understand
correctly, your central argument against "1JS under strict" is that:

(a) Strict mode is not popular.
(b) If ES6 syntax is strict-only, then ES6 may well be unpopular.

So why is strict mode not popular?  The answer is quite simple:  there's no
carrot.  It limits the user (in good ways, of course) without providing any
additional power to offset those limitations.  ES6, built exclusively on
top of strict mode, provides those missing carrots.

If that's the case, then why are some users vehemently anti-strict?  As
you've stated, javascript is a big tent with many loud voices inside.  It
doesn't matter *how* the language evolves, there are going to be users on
soapboxes proclaiming that "standards bodies suck" or shouting other
blustery provocations.  Change always creates winners and losers.  But the
language must evolve nevertheless.

What would convince you that strict-mode would not present a problem for
ES6 adoption, if ES6 syntax were strict-only?

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121230/0d84a68d/attachment.html>


More information about the es-discuss mailing list