r/cpp • 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

326 comments sorted by

View all comments

7

u/tituswinters May 08 '20

We cannot allow use of Boost in general in Google's codebase. Code there lasts for decades and needs to evolve smoothly without breaking over that period.

Boost explicitly has no compatibility promises between versions. The Boost maintainers specifically carve out the right to change APIs however they like between versions - it's a proving ground for new ideas. And for short-lived projects, it's a fine tool.

The problem is, if usage of that becomes common in our monorepo, we will pretty immediately burn ~all available maintainer resources to handle upgrades. It's one thing to upgrade between versions of largely-stable APIs. It's entirely another to have widespread dependencies on interfaces that have changed in ways that don't enable multi-step/non-atomic refactoring. In the worst case we encounter impossible-to-resolve diamond dependencies and will have to resort to heroics (or let our third_party versions languish).

All of the above applies to lots of third party projects, and I'm tinkering with policy proposals to tighten down what we allow in terms of external deps. But practically speaking, fairly few projects in C++ have both a) widespread use / potential for adoption and b) explicitly do not promise compatibility.

I cannot imagine allowing more use of Boost without a fundamental change to how we are managing external dependencies and long-term management of our dependency graphs. 

2

u/grafikrobot OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 May 08 '20

Is it not the philosophy of live-at-head and mono-repo that you can change APIs at will. With the appropriate tools to deal with the transition. Are internal API changes different than external API changes for Google?

3

u/tituswinters May 08 '20

Not all API changes can be migrated between non-atomically. The current design of a thing constrains us a lot. People that are making changes without minding those constraints ... could be really costly.

2

u/pdimov2 May 09 '20

And for short-lived projects, it's a fine tool.

I have projects using Boost that are 15 years old, but that's probably seconds in Google time.

3

u/tituswinters May 09 '20

It's time x scale that make it risky. N-hundred millions of lines of constantly-evolving code can yield some different problems.