Hacker News new | ask | show | jobs
by Touche 3997 days ago
> Can someone explain the reasoning behind having any kind of backwards compatibility?

Not breaking millions of websites.

2 comments

*billions.

Maybe even orders of magnitude more than that.

In what way would a cleaner ES6 break websites? Browsers aren't going to stop supporting ES5.
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.

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.

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.