Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost considered harmful? [closed]

Tags:

c++

boost

People also ask

Is Boost a good library?

Currently Boost is recognized as a very powerful C++ library, for each major version many C++ libraries from the community were added. The Boost reviewers have an advanced C++ skills and their contributions guarantee a high quality for many years.

Is Boost still maintained?

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 library fast?

boost and the C++ standard libraries are used to produce extremely fast production implementations.

Which Boost library can support container components?

The Boost Multi-index Containers Library provides a class template named multi_index_container which enables the construction of containers maintaining one or more indices with different sorting and access semantics.


Few points:

  • Using anything without understanding is considered harmful. But it is only the ignorant technology user (and his manager) who gets burned in the end.
  • You don't have to install boost to get the smart pointers - they are header only. And installation itself is rather straightforward, in the simplest approach just typing one or two commands.
  • Many of the Boost libraries and solutions are present in TR1 or will be present in C++0x
  • You will always depend on external libraries... Try to choose the one that have a bright future in terms of maintenance and support.
  • Unless you want to roll-out your custom solution - which would have some advantages and disadvantages.

C++ is not a novice-friendly language. With apologies to Scott Meyers, a beginner isn't learning just one language with C++, but four:

  1. The C parts
  2. Object Oriented parts: classes, inheritance, polymorphism, etc.
  3. The STL: containers, iterators, algorithms
  4. Templates and metaprogramming

I would argue that if the beginner is already climbing this mountain, they should be pointed towards the more "modern" aspects of C++ from the start. To do otherwise means that the beginner will learn C-ish C++ with regular pointers, resource leaks, etc. Find themselves in a world of pain, and then discover Boost and other libraries as a way to stem the hurt.

It's a complicated picture no matter what, so why not point them in a direction that has a positive pay-off for the invested mental efort?

As for dependencies, a great deal of Boost is header-only. And Boost's liberal license should permit its inclusion in just about any project.


Do you know how the compiler works ? Do you know how the OS works ? Do you know how the processor works ? Do you know how electronics works ? Do you know how electricity works ?

At some point you are using a black box, the question is, "is my ignorance problematic for what I am currently doing?".

If you have the taste for knowledge that's a great thing - and I clearly consider that a plus when interviewing engineers - but don't forget the finality of your work : build systems that solve problems.


I disagree. No-one would suggest that you should dive in to smart pointers without a thorough understanding of what's going on behind the scenes, but used sensibly they can remove a whole host of common errors. Moreover, Boost is high-quality production code from which a C++ novice can learn a great deal, in terms of design as much as implementation. It's not all hugely complicated, either, and you can pick and choose the bits you need.