3 ms·
In this case the npm ecosystem is providing more of a surrogate standard library. Imagine if there were no libc, for example, and so people had to reimplement a
by ubernostrum 11y ago
In this case the npm ecosystem is providing more of a surrogate standard library. Imagine if there were no libc, for example, and so people had to reimplement all those functions; would you really want one package per function because of how "Unix philosophy" it would be?
This is where the JavaScript ecosystem is right now -- JS doesn't have the kind of robust standard library other languages take for granted, so you end up with a lot of these things that look like they should be stdlib functions, but are instead third-party packages the entire world has to depend on for a usable programming environment.
- esailija 11y agoI don't understand the standard library argument at all. Standard library is always limited, there is always something that's not included - then what? This has nothing to do with the JavaScript standard library but the insanity of NPM. There are modules that have even more dependents than `pad-left` despite being included in the standard library (e.g. https://www.npmjs.com/package/date-now https://www.npmjs.com/package/date-now, https://www.npmjs.com/package/is-positive https://www.npmjs.com/package/is-positive, https://www.npmjs.com/package/is-lower-case https://www.npmjs.com/package/is-lower-case)
- ubernostrum 11y agoThe argument is that things like formatting a string -- including padding it -- should not be add-ons, they should be built into the core distribution you get as part of the language.
- esailija 11y agoI didn't say it shouldn't be part of standard library, I am saying that there is always something that isn't part of the standard library. My point is: if this module was something that shouldn't be part of standard library, what argument would you then use?
- yoklov 11y agoI think you're assuming libc is more robust and useful than it actually is. Libc is extremely minimal (and is full of pitfalls as well). JS has an extremely large and robust standard library in comparison.