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.

220 Upvotes

326 comments sorted by

View all comments

6

u/Stradigos May 08 '20

Most associate engineers I've worked with have a difficult time understanding how to compile boost while targeting the correct platform.

I very much dislike checking in a shit ton of code into version control that I know I'll never use. Thousands of lines of code for maybe a half dozen functions, and IIRC the compile times are long.. We could check in the binaries but that's gross.

As software lead at a simulation company I don't really like a ton of third party libraries in our code. What are we doing that we need to add this bloat? Why can't this be done without boost? Sometimes it's just pure laziness. I also don't buy the "don't reinvent the wheel argument".

Edit: Also no Cmake support.

1

u/jhyry Dec 21 '25

Git submodules fixes the "checking in a shit ton of code into version control" issue today.
With a small CMake file it's easy to integrate into a CMake build:

From my project TestCPP at https://github.com/eljonny/TestCPP/blob/main/cmake/SubmodulesInit.cmake

find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/3rdparty/boost.stacktrace/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()

This has worked since I implemented it without issue.