4 ms·
> And why is nodejs so much more dependency-happy than python? Could it be that nodejs has implemented package management more consistently and conveniently th
by plugin-baby 4y ago
> And why is nodejs so much more dependency-happy than python?
Could it be that nodejs has implemented package management more consistently and conveniently than other languages/platforms?
- Scarblac 4y agoThat's one thing, the other is the almost complete absence of a standard library.
- heleninboodler 4y agoYeah, I think this is a big one. One of the things that I have always liked about Golang is that the standard library is quite complete and the implementations of things are (usually) not bare-bones implementations that you need to immediately replace with something "prod-ready" when you build a real project. There are exceptions, of course, but I think it's very telling that most of my teammates go so long without introducing new dependencies that they usually have to ask me how to do it. (I never said the ux was fantastic :) This also goes to GP's "consistent and convenient" argument.
- peteatphylum 4y agoTotally agree. It feels like there is a pretty strong inverse correlation between standard library size, and average depth of a dependency tree for projects in a given language. In our world, that is pretty close to attack surface.
- galangalalgol 4y agoRust is another example of this. Just bringing in grpc and protobuf gets about a hundred dependencies. Some of them seemingly unrelated. For a language aimed at avoiding security bugs, I find this to be an issue. But a good dependency manager and a small (or optionally absent) stdlib has lead to highly granular dependencies and bringing in giant libs for tiny bits.
- dheera 4y agopip throws your dependencies in some lib directory either on your system (default if you use sudo), in your home directory (default if you don't use sudo), or inside your virtualenv's lib directory. npm pulls dependencies into node_modules as a subdirectory of your own project as default. Python really should consider doing something similar. Dependencies shouldn't live outside your project folder. We are no longer in an era of hard drive space scarcity.
- coredog64 4y agoAs of Python 3, pip install into the system Python lib directory is strongly discouraged. ISTR that even using pip to update pip results in a warning. That’s not to say that there’s not still some libs out there that haven’t updated docs to get with the times.
- kevin_thibedeau 4y agoMore distros should adopt the Debian practice of installing into dist-packages and leaving site-packages as a /usr/local equivalent for pip to use on it's own.
- cozzyd 4y agoHave you seen how much space a virtualenv uses? It can easily be >1 GB. For every project, this adds up. (Not to mention the bandwidth, which is not always plentiful).
- dheera 4y ago4TB hard drives are $300 these days.
- mardifoufs 4y ago4tb HDDs are closer to 80$ now, but that reinforces your point :). Even SSDs are now close to 300$ for 4tb!