Re:The state of JavaScript modules
by andreareina on Monday May 29, 2017 @07:21AM
(#14438557)
I've been using JS lightly for a couple of years, in earnest for a couple of months. From the perspective of someone who's comfortable in C, Lisp, Python I think the semantics are fine (given a certain subset).
One major issue I have with JS is that the standard library is severely lacking in the basics. We have Promises but Math.round only rounds to the nearest integer. We have generators but no string formatting (the template syntax is not a replacement).
> After ~2016: "Stop improving JavaScript, I can't keep up!"
The bad parts are still here that's the problem. The language didn't improve so much that it got new features. But var, ==, type coercion and co still exist.
> But var, ==, type coercion and co still exist.
They all have alternatives, and linters can help restrict you to those alternatives. As a developer, that makes it pretty doable.
I presume you too can appreciate why they can't simply be removed.
Re:The state of JavaScript modules
by aaron-lebo on Monday May 29, 2017 @05:17AM
(#14438220)
So use a linter which disallows var and some of the worst usages and and use libraries which make up where it's lacking.
It's the price of improving the language + backwards compatibility.
A linter never fixed the runtime behavior of a language, this is beside the point. The point is the assumption that Javascript is a better language today.
Re:The state of JavaScript modules
by aaron-lebo on Monday May 29, 2017 @05:38AM
(#14438281)
You mentioned var, let exists to fix those issues, hence the language just in that one area is better.
Re:The state of JavaScript modules
by tlrobinson on Monday May 29, 2017 @06:29AM
(#14438422)
The first two are totally solvable with a couple ESLint rules (`===` and `no-var`), and the latter somewhat solveable with TypeScript or Flow.
After ~2016: "Stop improving JavaScript, I can't keep up!"
(Not a personal attack, just general sentiment I've observed)