Alex Rivera | Logout

Boost considered harmful?

Asked 2009-02-20T11:23:44.437
54

Lots of the answers to C++ questions here contain the response:

"You should be using boost::(insert your favourite smart pointer here) or even better boost::(insert your favourite mega complex boost type here)"

I'm not at all convinced that this is doing any favours to the questioners who, by and large, are obvious C++ novices. My reasons are as follows:

  • Using smart pointers without understanding what is going on under the hood is going to lead to a generation of C++ programmers who lack some of the basic skills of a programmer. Pretty much this seems to have happened in the Java field already.

  • Deciding which type of smart pointer to use depends very much on the problem domain being addressed. This is almost always missing from the questions posted here, so simply saying "use a shared pointer" is likely to be at the least unhelpful and possibly totally wrong.

  • Boost is not yet part of the C++ standard and may not be available on the specific platform the questioner is using. Installing it is a bit painful (I just did it using Jam) and is way overkill if all you want are a few smart pointers.

  • If you are writing FOSS code, you don't want the code to be heavily dependent on external libraries that, once again, your users may not have. I've been put off using FOSS code on a number of occasions simply because of the Byzantine complexity of the dependencies between libraries.

To conclude, I'm not saying don't recommend Boost, but that we should be more careful when doing so.

Edit
Report

3 Answers

1

I would agree with the point about smart pointers. I am a C++ beginner, and when asking a simple question about pointer syntax, one answer suggested smart pointers were the way to go. I know I'm not ready for boost (I'm not really ready for the STL either), so in most cases I steer myself away from that type of suggestion.

answered 2009-02-20T12:32:32.510
0

Boost is a great library. I really hope that it grows in breadth and acceptance. Use it, extend it, and promote it.

One of the great things about the .NET community is that it has a great base class library. One of the fundemental problems with C++, I believe, is the minimalistic C++ standard library. Anywhere you go to develop code, FOSS or corporate, there is some selection of libraries that are used since there isn't a broad standard library. So you end up being a INSERT_YOUR_COMPANY_HERE C++ programmer and not necessarily too transferrable. Yes, you design/architecture skills transfer, but there is the learning curve with picking up familiarity with whatever set of libraries the next place is using. Where as a .NET developer will basically be using the same class library and can hit the ground running. Also, the libraries that are built (and reused) have a broader base to build on.

Just as an aside, you can use http://codepad.org for a code paste bin and it supports boost!

answered 2009-02-20T20:45:44.803
0

I have worked for companies who have viewed boost as library to avoid due in part to its past reputation as a poorly managed project. I know things have changed with the project, but commercial projects who want to use boost must be aware of the source of the code contained in the library, or at least be assured that they're not going to be liable for IP or patent infringements.

Sadly, the library has this reputation and it will take a while for it to break before it sees wide use in the commercial sector. I also feel this is a reason not to recommend it blindly.

answered 2009-02-21T01:55:03.157

Your Answer