As for the "how to fix" I suspect the biggest step forward would be creating a decent standard library.
As for the "how to fix" I suspect the biggest step forward would be creating a decent standard library.
There's actually an active proposal for a standard library, but it is met with a lot of contempt from the JS community [0]
[0] https://github.com/tc39/proposal-javascript-standard-library...
I don't want to swear on HN, so I'll just say .. wow. So there are elements of the community who want to keep the deficiencies there so they can get micro-fame for filling them? People want to feel important by maintaining left-pad?
(also I think they meant moot rather than mute, but hey; also, this is software, we don't really respect idea precedence and any work may be rendered moot by the work of others at almost any time as technology shifts.)
The problem is not that the standard library is bad (It could be shite, it could be gold, it doesn't really matter). The problem is that regardless of what's in your "standard" library, you will have a VERY long tail of users interacting with your code in a user agent that just doesn't support it. Period.
So I think you can rephrase this whole conversation as not "make a better standard library!" but instead as "how do we bootstrap a better standard library into user agents that haven't been updated in 10 years?"
In which case suddenly NPM/Babel/Webpack start to make a lot of sense.
1) I don't know how to do x, lets google it, oh I have to use this _in vogue_ module.
2) oh this module seems to do what I want. _ship_
3) ~two months later~ oh bugger, that has a vulnerability, its not supported any more/API has wildly changed/new owner