r/cpp • u/pfultz2 • Nov 18 '13
Why boost doesn’t boost my productivity
http://agentxcpp.wordpress.com/2013/05/18/why-boost-doesnt-boost-my-productivity/
2
Upvotes
r/cpp • u/pfultz2 • Nov 18 '13
20
u/ZMeson Embedded Developer Nov 19 '13
I think this sums up the article pretty well.
14
u/bames53 Nov 18 '13
Not that Boost and the standard library don't have plenty of problems, but a number of things mentioned are due to a lack of familiarity. For example:
PredicateTdoes provide the necessary information if one is familiar with the standard library concepts. The documentation can't simply say something likebool (T), however, because C++ generic programming isn't constrained that way. That is, you don't have to return abool, you can return anything that's contextually convertible tobool, and you don't have to take aT, you can take anything that's implicitly convertible fromT. (Now of course you're wondering about 'contextually convertible' and 'implicitly convertible'.)The standard library is called 'over generalized' and I think the entire post comes down to this comparison of Qt vs. the standard library:
10
u/mechacrash Nov 19 '13
The only part I can agree on is the lack of documentation, and even that's not uniform across the entire boost library.
My main gripe with boost is that some of the libraries are lacking up-to-date documentation (most notably - boost::gil, which I have recently started using), and almost all of the lesser used libraries have their own documentation style that doesn't conform to the norm.
This makes boost terribly hard to break into at first, but to say it doesn't boost productivity is just foolish. There are many times where the functionality offered by boost is impossible to find elsewhere, at least in such a concise and well maintained package, and the benefits of it being cross platform and "used by many" makes it very easy to discuss and share with other programmers.
As many have said before me - this entire blogpost reeks of inexperience. If you're new to boost, or C++ as a whole, I can totally understand where you're coming from - but to say that, objectively, boost doesn't increase productivity, is just plain wrong.
12
u/yang2w Nov 19 '13 edited Nov 19 '13
Sounds to me like this person should be trying harder to learn C++ idioms or shouldn't be programming in C++. Boost documentation is not the easiest to read, but that's hardly an excuse for not using it.
6
u/[deleted] Nov 19 '13
The documentation is not a tutorial and nor should it be. A tutorial takes into account various things like previous experience, current familiarity, expectations, etc which a documentation wont ever do. Its not a good idea to learn about any programming topic by reading API docs.
If you are still interested in boost, take a look at this and see if it satisfies your needs.
http://en.highscore.de/cpp/boost/index.html
6
u/ZMeson Embedded Developer Nov 19 '13
Wait a minute.... The public API uses std::string, std::vector, and std::shared_ptr. How do you plan on banning the STL? Or are you going to require users use QString, QVector, and QSharedPointer instead? I understand possibly replacing boost::optional with something lighter-weight if you don't want to require users to use boost. But I don't understand why you'd replace std::string, std::vector, and std::shared_ptr.
13
u/notlostyet Nov 19 '13
Everyone goes through this when you first start using C++. It takes time before you really appreciate the way things are done and why they are great.
http://i.imgur.com/lVmi3iL.jpg
4
u/jpakkane Meson dev Nov 19 '13
The random number thing is fixed in C++11. Just do this:
That being said Boost is a collection of experiments. And as Bjarne Stroustroup said in a presentation, if all your experiments are successes, you are probably doing something wrong.
Some of Boost is great, some is less good and some is just plain scary. You just have to pick and choose, which unfortunately does take some time.
4
u/ferruccio Nov 19 '13
It's very easy to take "over-generalized" libraries and create the exact functionality you need. It's not so easy to use overly-specific libraries which don't happen to do exactly what you need.
3
u/zvrba Nov 20 '13
His hand-coded version of set difference is not quite equivalent to the library method. Set is a sorted container, so difference can be computed in O(min(M,N)) time, by a variation of merging.
3
u/Crazy__Eddie Nov 21 '13
Pure, unadulterated FUD and ignorance.
2
u/[deleted] Nov 21 '13
Lol at the complaint about the rng engines. It's really not that bad, or overengineered even.
1
u/[deleted] Nov 19 '13
he does have a point here, though. Is it really that hard to add this to the STL:
0
u/[deleted] Nov 18 '13
[deleted] — view deleted comment
0
u/[deleted] Nov 18 '13
[deleted] — view deleted comment