Boost considered harmful? [closed]

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.


  • It's impossible to understand everything thoroughly all the time. So take the word of many professional C++ developers for it that many parts of boost are indeed very useful things to use in your day-to-day development.
  • The inclusion of quite a lot of boost in C++0X is testament that even the team that manages the evolution of the language thinks that boost is a Good Thing (tm)
  • C++ is a weird, tough language. It's relatively easy to learn compared to how incredibly hard it is to master. There's some really arcane stuff you can do with it. Boost::mpl builds on some of those arcane things. I love boost, but I cringe every time I see someone in my organisation use boost::mpl. The reason: even quite seasoned C++ developers have trouble wrapping their head around how it works, and the code that uses it often reflects that (it ends up looking like someone banged code out until it worked). This is not a good thing, so I partially agree that some parts of boost should not be used without caution (boost::spirit is another example).
  • The C++ standard is also a weird thing. Most common compilers don't implement all of the existing standard (e.g. template exports). It's only a guideline of what to expect.
  • If your developer doesn't have the savvy to decide which smart pointer to use in a particular situation, perhaps they shouldn't be messing around in that part of the code without senior guidance.
  • There are always external libraries, starting with the run-time. A lot of boost is header-only so it does not introduce new external dependencies.