Note that there are some explanatory texts on larger screens.

plurals
  1. POBoost considered harmful?
    text
    copied!<p>Lots of the answers to C++ questions here contain the response:</p> <blockquote> <p>"You should be using boost::(insert your favourite smart pointer here) or even better boost::(insert your favourite mega complex boost type here)"</p> </blockquote> <p>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:</p> <ul> <li><p>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.</p></li> <li><p>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.</p></li> <li><p>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 <a href="http://en.wikipedia.org/wiki/Perforce_Jam#Boost.jam" rel="nofollow noreferrer">Jam</a>) and is way overkill if all you want are a few smart pointers.</p></li> <li><p>If you are writing <a href="http://en.wikipedia.org/wiki/Free_and_open_source_software" rel="nofollow noreferrer">FOSS</a> 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.</p></li> </ul> <p>To conclude, I'm not saying don't recommend Boost, but that we should be more careful when doing so.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload