Third-Party Utility Libraries
This section only introduces several libraries that complement the C++ standard library (analogous to Guava or Apache Commons in the Java ecosystem). It does NOT cover logging and other broader categories (they will be briefly touched upon later in "Common Libraries").
Google Abseil
This is a library I strongly recommend, for several reasons:
- All Google open-source projects are migrating shared dependencies to depend on Abseil; there is a dedicated internal team maintaining it.
- Rich code comments, dedicated guides (https://abseil.io/docs/cpp/guides/), and blog posts explaining rationale (https://abseil.io/blog/, https://abseil.io/tips/).
- Backports many C++14/17/20/... components to C++11 with APIs that closely match the standard.
- The current feature set is pragmatic and down-to-earth—usually you can guess the implementation approach—yet highly practical:
- Containers: supplements to the standard containers, mainly performance oriented; also implements some features only added in later standards (
try_emplace
,contains
, etc.). - Hash: the standard library's hashing story is weak (as noted earlier). Abseil offers a better hash framework while integrating smoothly with standard containers.
- Meta: some older standard library implementations have incomplete or buggy
type_traits
; Abseil effectively backports/fixes a number of these utilities. - Numeric:
int128
(and related utilities) can be very handy in certain domains. - Random: addresses issues in the standard library's random facilities, providing more scientifically grounded implementations and interfaces.
- String Formatting / Utilities: the C++ standard string facilities are notoriously awkward (as noted earlier); Abseil fills many of the gaps.
- Status: a structured error handling mechanism—often used instead of exceptions. Even if you embrace exceptions, there are still places where returning a status object is clearer.
- Synchronization: more ergonomic synchronization primitives, already integrated with thread-safety annotations.
- Time: more user-friendly abstractions (again, as mentioned previously) plus helpers for parsing/formatting user I/O.
- It even ships companion clang-tidy checks—extremely thoughtful.
Boost
Boost is a large, community-maintained "grab bag" library collection that started early. Overall I personally do NOT recommend using Boost wholesale. Reasons:
- Code quality varies significantly across components; some are quite weak.
- To support very old C++ standards (e.g. C++98), many hacks were employed, leading to:
- Worse performance.
- Cryptic diagnostics.
- Complex implementations with potential hidden pitfalls.
- There have historically been multiple breaking changes across Boost releases.
- Standard library backports in Boost sometimes deviate from the actual standard specification.
- Many third-party libraries depend on Boost, easily creating diamond dependency shapes. In many environments you are consuming prebuilt binaries instead of building everything from source. Since Boost does not guarantee ABI stability, diamond dependency situations become very difficult to resolve.
If you need a small, isolated Boost component, consider reading the corresponding Boost source and reimplementing the minimal subset you actually require.
Facebook Folly
Commentary for this section relates to internal company context and is intentionally omitted here.