ES6 doesn't need opt-in
Mark S. Miller
erights at google.com
Wed Jan 4 15:14:57 PST 2012
On Wed, Jan 4, 2012 at 9:24 AM, Andreas Rossberg <rossberg at google.com>wrote:
> On 4 January 2012 17:39, Mark S. Miller <erights at google.com> wrote:
> >> Style guides will probably
> >> suggest to put "use strict" on top of every Harmony program to escape
> >> the mess.
> > Every sane style guide will do so. And every linting tool should by
> > warn on the presence of any non-strict code. And every IDE should offer
> > make the code strict if it isn't already.
> Well, I had hoped that with ES6 we have more elegant ways of opting
> into Harmony than something like the "use strict" kludge. I also
> thought that that was part of Dave's motivation.
For style guides targeting ES6 only code, yes. They should simply advocate
opting into strict mode in some way, and the preferred choice is unlikely
to be "use strict";. For ES5, or for any code that must work on pre-ES6
browsers, "use strict"; is of course the only way to opt in to strict mode.
I was thinking in terms of styles guides that anyone might write in the
next three years.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss