NPM and Left-Pad: Have We Forgotten How to Program?
NPM modules can be used on browsers. On browsers, space is a premium.<p>Why would you want to install a 500kb dependency that has only one function you need, when you can install a 10kb dependency that has it?<p>Would you want each of your five 20kb dependencies to re-implement the same 5kb function, increasing the code you must send to the client by 20%, or would it be more optimal for each of those dependency to use the same 5kb function?<p>The author rants about practices of developers from different programming environment, without experience, without figuring how things came to be. If he did give an effort to think from the perspective from Node.JS developers he’d have addressed the previous two points.<p>This is like going to a friend’s house and complaining everything is put in the wrong place. It would have been wise to immerse in Node.JS conventions and observe for a while before making comment.<p><i>EDIT: Reply to scrollaway:</i><p>I&#x27;ve also understated the problem.<p>Let&#x27;s look at the problem in the current Node.js environment, it&#x27;s not uncommon for a web app to have 20 dependencies, each of those have 10, and each of those 10 have 5. That&#x27;s a total of 20 times 10 times 5 = 1000 dependencies in total.<p>Let&#x27;s say you were to remove a 10 line library function that&#x27;s &quot;standard library-like&quot;, used by 15% of those dependencies, and have each of the existing dependencies re-implement that in each of those dependencies that uses it.<p>15% times 1000 times 10 lines is 1500 lines of code.<p>So if you&#x27;re going to troll a solid argument by nitpicking, do it properly and get the details right.