Skip to content
htzh edited this page Oct 13, 2014 · 11 revisions

Boost is a large library. It is possible my sentiment should only be directed towards certain Boost packages and I may be unfair to many parts of Boost that could be used without pulling in many thousands of lines of code. So I am still willing to try Boost if it seems unavoidable and the dependence can be localized and contained (e.g. I am interested in parts of Facebook's folly).

If you g++ -E or clang++ -E (remember to pipe to less or redirect to file as well) a one-liner like

#include <boost/network.hpp>

and wc on the output you will likely find something like

$ wc test1
  279506   897765 10174700 test1

If you use a Clang based completer also check the preamble file generated:

-rw-r--r-- 1 haitao None 118393832 Oct  9 15:18 preamble-fae90a.pch

No wonder all your tool chains are creaking and feeling sluggish ever since you added Boost as a dependency. With all the template magic if you run into any issue here how are you going to debug it? If you have a Boost expert that you are happy to keep on the payroll well by all means keep on using Boost. For me STL is enough of generic programming and I will look to smaller specialized libraries (Gumbo for HTML parsing, PugiXML for XML parsing) or frameworks that are better compartmentalized and easier to understand (like Poco) for my needs.

Note: boost/network.hpp is not in the official Boost distribution but a separate cpp-netlib library that depends on Boost Asio.

Clone this wiki locally