DEV Community

Discussion on: Explain Like I'm Five: What's a standard library?

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

There's a fundamental contention between maintainability/bulk and usefulness.

C++ opted for a minimal standard library for the longest time. It kept the language small, and made it easy to keep those libraries maintained. But for the longest time a lot of basic tasks in C++ were a chore, since there just wasn't a library for them. It really felt like you couldn't make a pure C++ program since there was always something missing. (This has changed in recent years, but it still leans towards minimal)

Compare this to Java that seemed to put everything and anything into the standard library. You could develop things quickly, since everything you needed was there. Over the years however a lot of the API became antiquated. But since it's part of the standard it's stuck there forever, requiring maintenance and guaranteed support. Or you have to deprecate and risk breaking somebody's project.

Languages like Python and NodeJS take the approach of having community supported packages for a lot of featureS (though Python's standard libray is quite feature rich on its own). The package approach is a good way to keep the language easy to use without maintaining a large standard library. It has the drawback that many, potentially essential, APIs are maintained at sub-par quality, and may be abandoned by their developers.

Nobody knows what the the right balance is. It's not likely the same for each language, as it's more domain driven than language drive. Certainly though an easy way to integrate community packages is a huge boon. Having too much crud lying around however, both standard and in the community, hurts everybody though.