Does it make sense to restrict yourself to the STL libraries when learning C++ and then tackle boost and its additions after you have become fairly proficient with vanilla C++?
Or should you dive right into BOOST while learning C++?
Ultimately, you should learn both. But STL can be learned in isolation, whereas boost won't make much sense until you understand the STL, since that's what Boost is modeled on, and designed to extend. So learn to use the STL as part of learning c++.
After 20 years of active Boost development, it's now 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.
No, just that there doesn't exist a data structure/algorithm in the STL to correctly solve every problem you can come up with. If your problem is such that you can't find a way to couch it in terms of the STL, writing your own code might be the only option.
The STL has some core concepts to it. Boost builds on and expands on them. If you understand them, then moving right on to Boost may be of use to you. If not, I would start with the STL.
vector
, list
and deque
, and associations like map
, set
and their multi*
and unordered_*
varieties). Sometimes you can swap one for the other -- sometimes you can't. Know their strengths and their limits.copy
differs from copy
specialized for const char *
).bind1st
, ptr_fun
and mem_fun
): the syntax can obscure their utility.string
-- and when not to use it. (All string classes have tradeoffs: learning the pros and cons of the standard one is educational).The principles used to design the STL are built upon and expanded on by the Boost libraries. If you get them, Boost is manageable. If you don't, and Boost ends up hard to follow, you can go back to the STL to get your bearings.
(In general Boost really pushes the boundaries of the language. If you decide you want to really push your own knowledge of C++, and test if you really know what you think you know then it can provide an interesting challenge. I've used C++ for more than a dozen years, have taught other people how to use it, have acquired proficiency in many more high-level languages since then and Boost still surprises me. It's very useful, but its not trivial).
I'd suggest getting a clear handle on STL, before looking at Boost. Boost is meant to build on top of STL and many of the libraries are slated to become part of the standard library eventually. Boost libraries are generally less mature and less standard than STL. Also, many boost libraries go too far, in my opinion, adding "features" that don't natively exist in C++ (leading to really insane syntax). In many cases there are more sane C++ idioms available for solving most programming problems without using these arcane Boost libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With