|
|
|
|
|
by roblabla
2930 days ago
|
|
I mean sure. But I also need to parse UUID. And do other things with it. Even if I didn't need to, I'd still likely use the uuid-1345 crate for it. Here's the thing: If I import this code in my codebase directly instead of using a library, it suddenly becomes my "responsibility" if it breaks. And when we're talking about a FOSS side-project, I don't have that kind of time. Third-party libraries means I get any improvements and bug-fixes for free. And if it breaks, I get to talk with the original maintainer to figure it out, and we're suddenly two people, with one hopefully knowledgable enough on the topic, working on the problem. Importing this kind of thing in make codebase makes it an ugly unwieldy mess that will inevitably break, and I suddenly will be alone trying to figure out what I did wrong. This is what's good about npm and libraries: the community that's built around it. |
|
Your view of dependencies is very idealistic. And if I'd venture to guess - apologies if I'm wrong - young, at least to programming. I'm saying this because you don't tend to hear such phrases once reality hits.
Everything you said can be flipped:
> If I import this code in my codebase directly instead of using a library, it suddenly becomes my "responsibility" if it breaks.
I have full control & understanding of the code; I can adjust & trim so it fits as much as possible. If it breaks, I can fix it directly.
> And when we're talking about a FOSS side-project, I don't have that kind of time.
Copying/hand rolling some trivial code is often faster than deciding among a dozen libraries which do the same thing, reading their docs, their issue pages and open PRs, adding and integrating to my project.
> Third-party libraries means I get any improvements and bug-fixes for free.
I must keep the dependencies updated. I must read changelogs and hope nothing breaks.
> And if it breaks, I get to talk with the original maintainer to figure it out
I must use inefficient communication with a more-often-than-not absent maintainer in order to resolve my problem instead of fixing it directly.
> I suddenly will be alone trying to figure out what I did wrong
I am able to be self-reliant in fixing the problem, because I wrote the code and I understand it.
I do not have to trust the maintainer of the package or the maintainers of any of its transitive dependencies to be competent or non-evil.
---
For some things this is worth it. IMO for generating 16 random bytes it is not worth it.