Hacker News new | ask | show | jobs
by altmind 2712 days ago
I'm alerted that javascript tends to bloat the stdlib. Most of the features mentioned can be implmented as a external library. This is benefitial for users as they can switch the implenmentation and upgrade versions without waiting for all of their users to upgrade the runtime first.

The prime example of javascript unnecessary bloat is fetch api which is mere wrapper for ajax calls, was developed a while ago but still cannot be used because of lack of support in older runtimes.

2 comments

From a performance standpoint it’s way better to have stdlib grow as opposed to JS bundles. Modules aren’t shared within a page so you’d end up with a lot of duplicated code that the user would have to continuously download and parse.
The problem here you can only rely on stdlib when most of your users have runtimes with it. For the browser features, you may never live up to this.

Its worse to forever live with two implementations(native and polyfill) and as large bundles, double the troubleshooting effort and extra support.

I, on the other hand, am happy with this. It means not depending on a 3rd party (whose motivation or trustworthiness may fluctuate), it's easier to re-use code form other projects, and we don't have to worry about "what version of .each are we using?"

I do believe your concerns are still real ones, however. Fortunately, we can poly-fill.