April 22, 2019

Boost Your C++ Programming


  • October 17, 2005
  • By Ibrahim Haddad

Bj�rn Karlsson is the author of a new book, Beyond the C++ Standard Library: An Introduction to Boost. The book talks about the Boost libraries--which are top-notch C++ libraries--and examines twelve of the libraries in great detail. We had a talk with Bj�rn, to get his thoughts on what makes Boost so important for C++ programmers.

LinuxPlanet: Tell us a bit about the history of the Boost C++ libraries and your involvement with it.

I actually "discovered" Boost by coincidence. Five years ago, while searching the Internet for good C++ sites, I stumbled across www.boost.org. There, I found not only a collection of C++ libraries that blew my mind, but also a fantastic community of C++ programmers. These programmers/designers/visionaries were the best I've seen, so I stuck around. It all started in 1998, when the C++ Standard was ratified. Beman Dawes, a member of the C++ Standards Committee, started Boost with the specific vision of continuing the work of finding and creating C++ libraries that would be well suited for inclusion in the C++ Standard. Starting with just a handful of committee members, Boost grew quickly, and the community now has several thousand participants. Most of the action takes place around the Boost mailing lists. Of course, to the majority of people, the most important part of Boost is the collection of libraries. There are currently more than 60 Boost libraries, ranging from smart pointers to meta-programming facilities. The widespread use of these libraries is interesting both because it shows the great importance of open source communities, and because it shows that it is still possible to contribute to the evolution of programming even as an individual (the libraries in Boost have all been created by volunteers).

LP: How do the Boost libraries contribute into making C++ programming more elegant, robust, and productive?

Those are three good questions in one, and I'll try to answer them separately. First, the elegance comes from how the Boost libraries allow you to focus your code on the problem you're trying to solve rather than create auxiliary lots of functionality. For example, Boost.Lambda allows you to create function objects on the fly, meaning that you are able to call STL algorithms and supply the required function objects directly at the call site. Second, the Boost libraries add robustness by providing proven implementations of crucial components. For example, Boost.Smart_ptr contains a range of smart pointer types that help you eliminate memory leaks, which we know is an all too common problem in many C++ programs. Third, the improved productivity simply comes from reusing proven, well designed, C++ libraries; these properties are true for all the peer-reviewed Boost libraries. There are many examples of useful Boost libraries that will make you more productive: I strongly suggest any C++ programmer to visit www.boost.org and take a look.

Most Popular LinuxPlanet Stories