Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do people seem to insinuate I would rather not use Boost? [closed]

Very often here on SO I see notes about boost such as

If you are fine with using Boost...

or

If you can use Boost...

And I wonder, what's that all about? What should I be weary of? When can't I use boost? What are the reasons not to use boost? In my opinion boost is a great extension to STL; sometimes very heavyweight and clumsy, but great nevertheless.

I am not really asking for opinions about boost as such. I am rather looking for some concrete examples when should I think twice before using boost.

like image 572
Jendas Avatar asked Oct 31 '15 14:10

Jendas


People also ask

Is Boost still used?

The original founders of Boost that are still active in the community includes David Abrahams. An author of several books on C++, Nicolai Josuttis, contributed to the Boost array library in 2001. There are mailing lists devoted to Boost library use and library development, active as of 2020.

Is Boost header only?

Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking. The only Boost libraries that must be built separately are: Boost.


2 Answers

When I can't use boost? In my opinion boost is great extension to STL, sometimes very heavyweight and clumsy, but great nevertheless.

Boost is not a library but a collection of largely independent libraries of individual quality. With this in mind, and also taking into account that I'm personally a big fan of most of Boost, here are some reasons I can think of for not using certain Boost libraries:

  • Some Boost libraries are redundant since C++11.
  • Some libraries are not widely used and thus require expert knowledge in your project which might be expensive to replace when an employee leaves the company.
  • Company guidelines which developers have to obey more for political than for technical reasons.
  • You have no guarantee that any Boost library will be continued to be maintained in the future. Standard C++ code written for some compiler today will very likely continue to work fine with a newer compiler by the same vendor 10 years from now, for simple commercial reasons. With Boost, you have to hope that enough competent people will have any interest in long-term maintenance.
  • No Boost library is documented as extensively, with so much material in countless books and on the internet, as the C++ standard library. Who will support you if you have some really exotic problem with a particular library? Surely with standard C++ your chances of finding people with the same problem (and existing solutions for the problem) are much higher.
  • Debugging some Boost code can be more difficult than debugging code that uses the standard library.
like image 66
Christian Hackl Avatar answered Sep 17 '22 19:09

Christian Hackl


Because it's not an extension to the C++ Standard Library (nor to the STL, naturally).

It is a third-party distribution, that you must download and install, locally and (for some Boost libraries, if you dynamically link) on the target system. You must manage and document the dependency.

I shan't enumerate all the scenarios in which this is not feasible, but it should be self-evident that you cannot always use non-standard code. Not everybody is working on a platform on which you can simply write yum install boost-devel, write your code and move on. The world of computers goes far beyond commodity desktop PCs.

That being said, most arguments for avoiding Boost are incredibly weak, due to its extreme portability, and the fact that the majority of Boost libraries are header-only (which reduces the packaging overhead significantly).

Seems like a lot of fuzz for nothing

I don't think writing the phrase "if you can use Boost" can be honestly described as "a lot of [fuss]".

like image 40
Lightness Races in Orbit Avatar answered Sep 18 '22 19:09

Lightness Races in Orbit