ES6 modules (sorry...)

C. Scott Ananian ecmascript at cscott.net
Mon Jun 16 11:42:22 PDT 2014


On Mon, Jun 16, 2014 at 2:27 PM, Matthew Robb <matthewwrobb at gmail.com> wrote:
> My argument is that you can keep everything the same as it is now but change
> the syntax to not use curlies and avoid the confusing similarity to
> destructuring. You could use `(a,b,c)` or `<a,b,c>` and it would all
> continue working as it does but be less confusing.

And (just restating my position), I'm saying that using a new
arbitrary punctuation here would be *more* confusing, since 99% of the
time the behavior will be exactly as if it were destructuring (ie, the
module isn't going to do any funny mutable binding tricks).  If it's a
"magic destructuring" at least make it *look* like a destructuring
(ie, no crazy "as" keywords), so that developers don't have to learn
where the magic hides unless it is necessary.
  --scott


More information about the es-discuss mailing list