3 ms·
> Libraries are a pain in C. They really aren't. At all. What exactly are the pain points you experienced with C libraries? > So most C programs use less of t
by fivea 5y ago
> Libraries are a pain in C.
They really aren't. At all. What exactly are the pain points you experienced with C libraries?
> So most C programs use less of them
This assertion doesn't hold any water. In all the years I worked with C and C++ projects, not even once did I ever heard "let's not add a library, it's hard".
Do you actually have a concrete, real issue in mind?
- cowsandmilk 5y ago> What exactly are the pain points you experienced with C libraries? 1. Varying build systems. Does the dependency use cmake? Autoconf? A shell script where you’re instructed to modify some variables specific to your system? 2. The above, but my software is shipping on Linux, windows, and Mac. What’s the best way to get this dependency compiled? Does upstream even support all these OSes? In all my years of doing C programming, I’ve never seen some add a single function library like is_even and then another like is_odd. But you do see it in languages where it is really easy to add libraries.
- convolvatron 5y agoin C I always end up building my own world because the default one is broken. for example null terminated strings are just really awful to work with. i'm not alone - alot of larger C projects have their own runtime, particularly memory management. another cross-cutting concern is multihreaded safety and scheduling. unless the library author broke those functions out, then I need to rehost it in my environment. so I usually end up forking any library that I want to use. this isn't all bad - I find some bugs and integrate the build. I adopt the library and develop and understanding of it sufficient to maintain it myself. contrast that to a language environment where those things - strings and threads and build are all standardized.
- mgaunard 5y agoMy point of view is that if you program in C you most likely care about being in control of what happens. Your approach makes perfect sense within that context.