4 ms·
Not necessary to pull whole boost
by alexott 9y ago
Not necessary to pull whole boost
- deleted 9y ago[deleted]
- eps 9y agoYou are missing gp's point. Any boost dependency is an instant no-go in a lot of projects.
- beojan 9y agoASIO doesn't require boost, there's a stand-alone version.
- felixguendling 9y agoAsio is also available as a standalone library without any dependencies (C++11): https://think-async.com/ https://think-async.com/
- arunc 9y agoWhy is that? Most of the modern c++ features were directly borrowed from boost
- whatidonteven 9y agoCompile time is a pretty big reason.
- jcelerier 9y agoso do you also not use std::unordered_map, std::shared_ptr, std::thread, std::regex, or std::mutex ? because they all come from boost.
- whatidonteven 9y agoI used boost extensively in the past (2006-2011). But I have been disillusioned by all the accidental complexity. It's easy to use the complicated parts of boost, but you lose sight of the inefficiencies you introduce all over the place, be it code bloat, unnecessary indirections, splitting up of allocations, or merely bloating your build times. Besides, std::unordered_map is flawed, the bucket interface forces suboptimal cache behavior. std::thread is such a thin abstraction, if you use C++ you might as well use it but it doesn't buy you much. same with std::mutex. std::regex on the other hand I avoid because it's easy to write "regular" expressions that cause backtracking with it. I would look at something like re2 instead, if I had to deal with text parsing a lot. or a proper LALR parser generator if the language is not regular.
- pzone 9y agoOnce they're safely out of Boost and implemented by the stdlib they're an order of magnitude more convenient to use. You can also be more confident in their future stability.
- jcelerier 9y ago> Once they're safely out of Boost and implemented by the stdlib they're an order of magnitude more convenient to use. I don't understand this. Most of the time the API doesn't even change; you can just do `namespace lib = std` or `namespace lib = boost` according to which one you want to use. In my own code for instance I have a header where I choose the std::, std::experimental or boost:: version of `optional`, `string_view`, and `any` according to the recentness of the stdlib I'm using; nothing else is needed.
- eps 9y agoGiven the universality of C++, everyone effectively ends up writing in their own dialect and there is a sizeable faction that uses it as "C with Classes" and "C with templates". So there is a lot of C++ projects that explicitly steer clear of modern C++ features, especially derived from the mother of all unholy abominations and the manifestation of everything that is wrong with the modern C++, the boost library. Give or take.
- pjmlp 9y agoUsually those are the projects where CVEs are a common feature..
- whatidonteven 9y agoThey are also the projects that get the most attention. I wouldn't rule out that python/javascript/whatever projects have just as many, if not even more, security flaws than your typical widely-used C library. They are just not interesting enough to warrant the required attention. The flaws are likely to be more subtle than simple buffer overflows too, think of all the abstractions involved.
- pjmlp 9y agoMy point was "C with Classes" and "C with templates" versus modern C++ best practices. C++ code can be quite safe, providing people stop writing C with C++ compilers.
- huhtenberg 9y ago... as are the projects that overdo on "modern C++" to the extent of introducing even more severe problems masked by the layers of needless abstraction. CVEs don't come from C or C++. They come from the lack of coding discipline and with all other things being equal C programmers are generally better skilled and more diligent than their C++ counterparts.
- pjmlp 9y ago
- zerr 9y agoSo far I've never met any clients or employers in my life who use Boost in production. How do you extract particular libraries (in a "good" way)? EDIT: as others commented, asio is available as a stand-alone lib as well. But this is not the case for most of other parts of Boost I believe.