3 ms·
Because Node packages are too fine-grained meaning the dependency trees and attack surface are greater - what in PHP would be a single library from a single ven
by krapp 5y ago
Because Node packages are too fine-grained meaning the dependency trees and attack surface are greater - what in PHP would be a single library from a single vendor could be a thousand packages in Node.
Because PHP packages are vendored by default, so there's an implicit stopgap on the propagation of issues from upstream.
Because PHP isn't dependent on a single vendor with a single global namespace, which avoids several of the issues you mentioned.
You can basically repeat that for other languages whose ecosystems benefit from the wisdom of years accumulated around package management and library design that Node seems to ignore.
edit: and the more I think about it, I suspect a lot of the bad practices in the modern JS ecosystem are due to the paradigm of having the same language running in the browser and on the server. This creates conflicting incentives in the way things are designed and deployed and one necessarily undermines the other.
- ss108 5y ago"I suspect a lot of the bad practices in the modern JS ecosystem are due to the paradigm of having the same language running in the browser and on the server. This creates conflicting incentives in the way things are designed and deployed and one necessarily undermines the other." What do you mean. Could you give some examples?
- krapp 5y agoSorry, I have a bad habit of posting when I'm halfway out the front door for something... For instance, as I understand it, the reason Node packages are so small is to make it efficient to run them in browsers. But that also exponentially increases the brittleness and vulnerability of the code. Optimizing for the always-live continuous deployment processes of web development runs counter to what is necessary for stable and secure code on the backend. I may be wrong, though, it's just something that occurred to me while I was wondering about this exact problem.
- ss108 5y agoInteresting, thanks
- gitgud 5y ago> as I understand it, the reason Node packages are so small is to make it efficient to run them in browsers Usage of npm packages in browsers is kind of an after thought, as originally people used a separate dependency management for the browser (bower js) The NPM ecosystem has a huge focus on reusability of libraries, smaller packages is just an emerging phenomenon when reusability is the goal. Also, small packages are a way to embrace the Unix philosophy, "do one thing and do it well" But yes, smaller packages create large dependency chains and a greater attack surface...
- tored 5y agonpm didn't historically do lock files either, thus is was easier to update npm packages unintentionally. npm is also a worse designed cli, just executing npm without any arguments and it will start installing regardless of where you are in the filesystem.