-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Hi and welcome to justuse!
Let's talk about how and why to use() more in detail. Conda or pip are not in opposition to justuse and we do not ask the user to choose one over the other, rather you need to think of these more as two sides of one coin. While conda, pip, docker, virtualenv etc. take care of public dependencies, including the dreadful business of dependency resolution, justuse takes care of all private dependencies.
There certainly are benefits to programs sharing the same libraries as public dependencies. The biggest and most obvious advantage of sharing dependencies is that memory can be saved, and also, it can be quite convenient to pip install a package and then have access to it in different programs and interpreters without requiring a lot of typing. On the other hand, a program that requires private dependencies via use() can be more greedy in terms of memory usage because it may install specific versions of dependencies that no other program needs. It also may require more lines of code to be explicit about what and how exactly (version, hash, aspects, other dependencies...) should be installed and imported - but there is a benefit to being this explicit: you can simply copy&paste your use() line and be certain it will work anywhere (except maybe on other platforms which require specifically compiled binaries, which also can be handled in use(), so the general point stands). Now, why would you want to have a more greedy program and manage your dependencies within your code? That's crazy, right?
Well, having pip or conda manage all your dependencies can be quite comfortable - while it works. The problem is that even small changes to dependencies can break your code - maybe by chance, maybe by design (deprecation comes to mind) - and whenever you install something via pip or upgrade something via conda, there is a slight chance it will break everything. I'm not exaggerating, it happened to me more than once. Especially system-wide upgrades can be impossible to recover from and require a full system reinstall. Now, virtualenv, docker etc. are there to reduce that risk, but imagine you want to deploy code on different machines with close integration with other programs, like maybe bash scripts or on platforms you can't have those tools as a user like mobile. Personally, I never liked virtualenvs and preferred full VMs and while docker admittedly is pretty cool, it can be annoying to set up right (does it even work on windows yet?). Now imagine, you can share a line of use() with someone on their phone or any other platform and it would install and import that package, with exactly the right version in a well defined manner, no messing with the global environment and accidentally breaking other code. If you use() a package in a presentation or on a blog, nobody has to guess what version you had installed via pip (which may not even be the one you thought you had installed, since pip might have upgraded it when you installed that other cool new package while sipping your coffee and not paying attention) - they can simply copy&paste your code and it will just work.