r/cpp • u/joaquintides Boost author • May 08 '20
Why you don't use Boost
I have a question for you: If you have decided not to use any of Boost, or are prohibited from doing so in your company/project, I would like to know why.
This thread is not meant to judge your reasons, and I won't engage into any kind of criticism about them: I'm merely trying to understand what the barriers are to adoption of Boost. It would be great if we could keep the conversation non judgemental. Thank you!
Conflict of interest: I am a Boost author of three.
222
Upvotes
201
u/movexig May 08 '20 edited May 08 '20
Boost is huge, and largely monolithic, with a complicated nest of (internal) dependencies for even simple functionality. It takes forever to install and build (in part because it consists of so many tiny files, many of which I don't actually care about), which increases my compile times and makes source control operations take longer. It's a lot of bloat, so it has to deliver something valuable to be worth using. The use case was stronger in the past, but as the language and standard library progressively improved over the past decade Boost is just not offering enough I actually want to use (and I can usually find better replacements elsewhere).
EDIT: I'm going to elaborate a little on what we primarily actually used from boost, and what we've replaced it with:
Smart Ptr, Variant, Optional, Array, Tuple, Atomic, Ref, Function, Bind: Replaced by C++11 and later standard vocabulary types
Type Traits: Obsoleted by C++ standard type traits
Date Time: Replaced by std::chrono
Foreach : Obsoleted by C++11 range-based for
Assign: Obsoleted by C++11 list initialization
Enable If: Obsoleted by C++11 std::enable_if, and soon again by concepts
Noncopyable: Obsoleted by C++11 language support
Preprocessor: Partially replaced by template metaprogramming (variadic templates and constexpr can solve a lot of problems we'd otherwise use PP for), remaining functionality reimplemented in-house
Thread: Replaced by C++11 std::thread
Format: Replaced by fmtlib, soon to be obsoleted in C++20
Unordered: Replaced by other flat hash map solutions
Lexical cast: Replaced by in-house solution
Pool: Replaced by in-house solution
Boost has a bunch of other stuff that's very useful, I'm sure, but we just never used any of it. We have no need for asio, beast, hana, spirit, etc. There's really no incentive for us to accept all that bloat when we can get the functionality we do want elsewhere now.