3 ms·
Why couldn't Javascript have ever built a halfway decent standard library? Much of the terribleness of the current programming environment could have been rect
by thrower123 5y ago
Why couldn't Javascript have ever built a halfway decent standard library?
Much of the terribleness of the current programming environment could have been rectified if this fundamental failure had not been allowed to continue.
- goohle 5y agoBrowser is the standard library for JavaScript language.
- PeterisP 5y agoYes, but it's not a "halfway decent" standard library because it does not include so many basic things that would be expected to be in the standard library.
- throw_m239339 5y agoNo, browser API and web standards are not part of the Javascript language AKA ECMAScript, otherwise Node.js would be forced to implement them.
- chrisfinazzo 5y agoWe've been down this road before, and learned...nothing. https://www.davidhaney.io/npm-left-pad-have-we-forgotten-how-to-program/ https://www.davidhaney.io/npm-left-pad-have-we-forgotten-how... Stupid debates over a formatting tool - or in this case, a simple conditional - should tell you that something is seriously FUBAR in Javascriptland.
- toyg 5y agoI reckon the problem is simply that the bar for entry in that world is non-existent. Anybody can learn html and javascript in a couple of days, so there is no filter. It's a blessing and a curse. But yes, a JS stdlib would solve 95% of the joke-level problems with the ecosystem.
- chrisfinazzo 5y agoYep. In fairness, I should mention that I haven't written much javascript myself over the years, so using CRA to quickly get a simple SPA off the ground has been rather nice of late. It's opinionated and has worts, but ~3 commands and you're 'off the the races' is hard to argue against.
- recursive 5y agoWell we got this now. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- scns 5y agoDeno provides one.
- Ginden 5y ago> Why couldn't Javascript have ever built a halfway decent standard library? Because it's consensus-driven, and that consensus is achieved on meetings organized every ~3 months. And because of strict backwards compatibility rule, everyone is extremely cautious. I tried to add new methods to Set, but proposal is basically being held hostage by subclassing proposal. https://github.com/tc39/proposal-set-methods https://github.com/tc39/proposal-set-methods
- krapp 5y agoJavascript has a perfectly decent standard library for its intended use case - scripting webpages. It was never meant to be a general purpose application or systems programming language. It was never meant to be used outside of the browser, much less to replace C++ and other languages in their respective domains. The "current programming environment" is the problem, and it doesn't exist because Javascript is superior to other languages, and should be used everywhere, but only because web developers are easier to find and cheaper to hire. And in any case, you could ship a "standard library" for javascript that covers most common use cases in a single static file. We used to do that, it was called JQuery. Even assuming for the sake of argument that Javascript's standard library is lacking, that doesn't justify the mess that is Node's micropackages.