3 ms·
I think a lot of it stems from the fact that many javascript developers blindly use packages for the most basic of things. The Left Pad mentioned above is a pr
by xs83 7y ago
I think a lot of it stems from the fact that many javascript developers blindly use packages for the most basic of things.
The Left Pad mentioned above is a prime example - do you really need a dependency for that? Start adding nested dependencies and well it's simply a mess!
- gitgud 7y agoThe Left Pad incident was a huge wake up call for the community, but not for the reasons most people state (dependencies are bad! why not write it from scratch!). Rather, it shows that dependencies should really be immutable, at least versions of dependencies anyway. It seems it's no longer possible to remove a package from npm, you're only able to deprecate it. Which means Left Pad cannot happen again, in this way. Software reuse is an important part of progressing technology and I think it should be encouraged... or at least made easy...
- stephenr 7y agoYou think it’s logical to have an entire module to do foo % 2 === 0 ? What about another module to call the first one and invert the return? Development based around npm modules is a joke
- gitgud 7y agoIt's not logical, but it should be possible to do something trivial in a package. What's the alternative? Allow only packages with code over 100 lines? 1000 lines? Packages are an excellent way to share code, regardless of complexity...
- krapp 7y ago>What's the alternative? Allow only packages with code over 100 lines? 1000 lines? The alternative is allowing packages with more than a single function. It's NPM and the javascript development culture which is enforcing the arbitrary limit of "no more than a single function per package." Sure, you can do trivial things in a package, but that calls into question the usefulness of enforcing that level of granularity versus having libraries of related functions, shallower dependency trees and less fragility.
- gitgud 7y agoWhat about libraries like npm packages like Lodash which contain a collection of small helper functions right? You might have to import everything from the package though... I suppose it's similar to the Unix philosophy, "do one thing and do it well". Also don't forget that people can repackage these fine grained tools into a single library package too.
- krapp 7y agoThat's fine. But the cultural acceptance of single-function libraries is still a problem. Before NPM, it wasn't even an issue - plenty of javascript libraries and jQuery plugins were being distributed that way. Why does a function to check if a number is even need its own namespace, and a dependency on another namespace which tests if it's a number at all, and a third to check if it's odd? What's the benefit to this? >I suppose it's similar to the Unix philosophy, "do one thing and do it well" Any philosophy can be taken too far.
- gitgud 7y ago> Why does a function to check if a number is even need its own namespace, and a dependency on another namespace which tests if it's a number at all, and a third to check if it's odd? What's the benefit to this? The benefit is modularity, separation of concerns and versioning but in this case it's ridiculous... Any philosophy can be taken too far That should be printed on my office wall!