3 ms·
> There are a number of semantic inconsistencies in JavaScript that need fixing, but the ES6 and ES7 additions do nothing to fix those, they merely add new feat
by outworlder 11y ago
> There are a number of semantic inconsistencies in JavaScript that need fixing, but the ES6 and ES7 additions do nothing to fix those, they merely add new features (read: complexity) to the language.
This, one hundred times. The current excuse for JS's surprising behavior is legacy and the fact that it was built in ten days or something.
Now that we are not in such a hurry, could we please fix the thing? It's not like new ES6 code is backwards compatible anyway.
I'd argue that we don't need many of those features. Lua is tiny, has a tiny interpreter, has a fast compiler (LuaJIT) and has been resisting new language additions and doing fine anywhere it's deployed. It helps that it has a nice design from the start.
But it doesn't have brackets and semicolons. People just love those, it seems.
- LukeB_UK 11y agoJavaScript can't fix the legacy issues because of backwards compatibility. Not in terms of making ES2015 code work on old browsers, but making old code work on new browsers.
- acdha 11y agoI agree with the first sentence but the last part seems incomplete. Were you thinking of the difficulties bridging old and new code running in the same app? I like the idea of an opt-in "use modern" to avoid breaking old code but that would get tedious if you needed to call between old and new code in the same app.
- 1ris 11y agoJavaScript even has "int" and such as reserved keyword. A hole lot of stuff could be fixed using them without breaking any compability.
- outworlder 11y agoCan't we run old code with the old semantics unless otherwise specified? We already have stuff that changes semantics, notably strict mode.