3 ms·
In Defense of Hyper Modular JavaScript
- zalgo 11y agobeing sensible is key. even though it presents a good argument for "hyper modular" packages, you'll never see me write a one :)
- bitmilitia 11y agoIm still confused how #npmgate ever turn into a discussion on code size :/
- zalgo 11y agohttp://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/ http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how...
- joshmanders 11y agoWhen developers who don't do much in the JavaScript realm, have extensive standard libraries with such functionality built in decide to compare their language choice with JavaScript and say "Why does this module even exist?"
- bitmilitia 11y agowhile true javascripts missing a "real" standard library - I don't see how, even if one was created, it would be able to keep up with the pace of the community...
- foobar1234 11y ago"It’s not about size, it’s about functionality" - i've been saying this to my girlfriend for years!
- ejcx 11y ago> Those who argue that having a dependency like left-pad adds risk to their project are essentially arguing against having any external npm dependancies in their project. No they absolutely are not. Having a few dependencies is something that almost all software has. Depending on left pad means more than just "I'll have problems if it is removed". It means you'll have problems if it is modified. It means you'll have problems if it has a vulnerability that needs to be fixed. It means you'll have problems in tons of different circumstances. Depending on things willy-nilly is a bad practice. Trusting left pad written by god knows who is a little different than trusting something like jquery that has been around for 15 years.
- bitmilitia 11y agoIf your referring to external dependancies as "how many times you require a dependency in your code", then realize that large projects like babel are actually composed of smaller dependencies under the covers: https://github.com/babel/babel/tree/master/packages https://github.com/babel/babel/tree/master/packages So wrapping smaller packages in a larger package doesn't change whats happening behind the scenes. If your referring to "just not having external dependancies at all" then good luck writing anything of value without first recreating the wheel. As to the question of if the code is modified, thats what semver is for. Production apps should always link to a specific version of a library.