News for hackers. Stuff that matters.
Re:ES6: The features I'm most excited about by charriu on Monday July 06, 2015 @05:03AM (#9837734)
I'm a bit worried about ES6 making the language harder to understand.

For example, scoping: For backwards compatibility reasons, var has to stay function scoped. But now we also have let, which has different scoping rules. Also, Symbols: [Symbol.iterator]() - what? Why?!

On the other hand, stuff like arrow functions, template strings, modules and tail optimization are awesome.

Re:ES6: The features I'm most excited about by alkonaut on Monday July 06, 2015 @05:23AM (#9837803)
Can someone explain the reasoning behind having any kind of backwards compatibility? Who would pick a worse-but-compatible ES6 over a better incompatible version?

For example, the scoping rules: why have two separate scoping rules for let and var? To put it another way, would ES6 have let and var with differing scoping rules if it was designed today? If not, then it's a flaw (any difference from what a clean redesign would look like I consider a flaw).

Why not just make a simple and consistent syntax?

Re:ES6: The features I'm most excited about by Touche on Monday July 06, 2015 @08:40AM (#9838649)
> Can someone explain the reasoning behind having any kind of backwards compatibility?

Not breaking millions of websites.

Re:ES6: The features I'm most excited about by pluma on Monday July 06, 2015 @09:14AM (#9838836)
*billions.

Maybe even orders of magnitude more than that.

Re:ES6: The features I'm most excited about by alkonaut on Monday July 06, 2015 @11:16AM (#9839675)
In what way would a cleaner ES6 break websites? Browsers aren't going to stop supporting ES5.
Re:ES6: The features I'm most excited about by bzbarsky on Monday July 06, 2015 @11:41AM (#9839878)
Browsers aren't likely to implement two separate languages either. Furthermore, forcing people to pick between "ES5" and "ES6" if they just want to use a single ES6 feature is pretty bad.

So your fundamental choices are really an ES6 that is backwards-compatible or an ES6 that is not used.

Re:ES6: The features I'm most excited about by alkonaut on Monday July 06, 2015 @03:28PM (#9841589)
On the other hand forcing newcomers to learn the warts of ES5 when they could learn what is becoming a reasonably elegant language isn't ideal either. Two scoping rules, for example.

An ES-latest runtime + transpilers would be all that browsers needed.

Re:ES6: The features I'm most excited about by bzbarsky on Monday July 06, 2015 @04:03PM (#9841832)
This has in fact been debated back and forth on the es-discuss mailing list and in TC39, especially given experiences with strict mode. The decision was generally made to not have more modes and to just have a single JS language.

You don't have to agree with that decision obviously, but this isn't something that happened willy-nilly.

Re:ES6: The features I'm most excited about by dmak on Monday July 06, 2015 @05:27AM (#9837818)
What about it is not simple and consistent? Two different syntaxes, and two different expectations and rules. Var is function scope, and let is block scope.
Re:ES6: The features I'm most excited about by alkonaut on Monday July 06, 2015 @06:31AM (#9838051)
I feel like in a new design you would pick one or the other, as a second scoping rule would not carry its own weight in terms of what problems it solves vs the complexity of implementing runtimes or learning the language. In that case I'm almost certain you would go for block only as it is the default in nearly all curly braced languages.
Re:ES6: The features I'm most excited about by techiferous on Monday July 06, 2015 @11:20AM (#9839700)
Yes, as a matter of style you could just use let everywhere, and know that var is there for legacy compatibility reasons.
Re:ES6: The features I'm most excited about by untog on Monday July 06, 2015 @12:19PM (#9840206)
I think they have selected one over the other - let. var exists for compatibility, but there is zero reason to use it in new code.
Re:ES6: The features I'm most excited about by woah on Monday July 06, 2015 @08:36AM (#9838621)
Python 3
Re:ES6: The features I'm most excited about by pc2g4d on Monday July 06, 2015 @06:03PM (#9842468)
Exactly what came to my mind
Re:ES6: The features I'm most excited about by laichzeit0 on Monday July 06, 2015 @10:13AM (#9839191)
> I'm a bit worried about ES6 making the language harder to understand.

Welcome to C++.