4 ms·
> You can't compare Javascript to C or Bash I'll remind you that you are the one who mentioned C. I just mentioned the Unix philosophy, which really should be
by ironmagma 3y ago
> You can't compare Javascript to C or Bash
I'll remind you that you are the one who mentioned C. I just mentioned the Unix philosophy, which really should be language-agnostic.
> So what even is the point?
There actually is a reason, which is bundle size. There is no standard library in JavaScript, or at least any standard library present may not match the version you expect, due to different browser versions. The target platform also has no pre-downloaded dynamically linkable libraries, so everything must be bundled statically. If many of your dependencies can use some common logic, that reduces the bundle size. The fact that they aren't is too bad, but reflects mismanagement more than nature of the system, since the system enables sharing.
But regardless, what's the point of having small dependencies at all? I think there is a pretty strong reason to do that and it's to make the dependencies easy to think about, their scope limited, the chances for bugs small. In Python, it is quite trivial to end up with two incompatible dependencies, since you cannot reconcile versions easily. Recently this has gotten better with Poetry, but NPM has had a long head start on it in this aspect.