r/programming • • Sep 04 '26

Avoid adding new library to project: 10-year retrospective

https://pvs-studio.com/en/blog/posts/1408/
171 Upvotes

35 comments sorted by

View all comments

Show parent comment

5

u/Full-Spectral Sep 04 '26

There are other variations as well. For instance, in my Rust project, it's just for brand new, 64 bit Linux, and for a particular variant of it even. I could have used Rust crates for a lot of stuff, but instead I just provided safe wrappers around the equivalent OS calls.

So I avoided probably 50 transitive dependencies, and I don't think that qualifies as NIH syndrome (though I'm a proud member of the NIH committee either way.) And my project which would probably be taking 2 minutes to rebuild from scratch (even at this early stage) rebuilds in 2 seconds.

Yeh, it's possible one of these OS calls has a memory issue. But the odds are so low that that's very way down my list of concerns, particularly given that much of the Rust standard library is also just wrappers around the OS.

In other cases, I write my own because I've been doing it for decades and am very comfy doing so. So, so far, I have a completely SOUP-free project that covers a lot of functionality. And my implementations only have to meet my needs. No portability concerns, no huge performance requirements, no accessibility concerns, etc... And it all is completely integrated, consistent, throughout, with no duct taping together bits and pieces of 3rd party code.

Obviously everyone can't go that route, but there are a lot of benefits if you can.