Home » Why don’t C++ Game Developers use the boost library? [closed]

Why don’t C++ Game Developers use the boost library? [closed]


Some developers do, some developers don’t (in games and elsewhere). It depends on what the needs/requirements of those developers are, and what existing technology they have to leverage.

C++’s standard library is often given the same treatment, and people often wonder the same thing you are wondering about it, too. Most of the reasons are similar, for example:

  • A developer may already have an in-house library of functionality that provides the same services that the standard library or Boost provides. Such in-house libraries were often written long ago, when implementation support for the standard library was weak and Boost was basically non-existent, so they more-or-less had to be written. In this scenario, it’s usually not really worth transitioning away from the in-house functionality — it would be a major porting effort that would destabilize a lot of code, and provide almost no benefit.

  • A developer may be working on platforms where compiler support for the advanced C++ techniques leveraged by Boost are not well supported, such that the Boost code doesn’t compile at all or performs quite poorly. This applies to the standard library as well, although much less so these days.

  • Boost and the language’s standard library are general purpose, and while that is fine and good for most applications, sometimes a developer has specific needs that can be better addressed by more specialized containers.

I think the above are two reasonable reasons, although there are certainly others. You have to be careful though because many reasons for avoiding Boost, the standard libraries, or whatever boil down to “not invented here” syndrome, which can be an indication that the reason isn’t very well grounded in practical realities.

Also remember that the needs of a large-ish studio are usually very different from the needs of an individual developer. For example, an individual developer probably has less legacy code floating around to maintain and so perhaps porting from a home-grown version of the Boost or standard library functionality will not be as big of a time sink and will save that developer from having to maintain that code as extensively in the future — thus invalidating my first bullet point.

In the end, it is all about evaluating your requirements and time investiture against your desired goal and determining which option meets your needs the best. Developers who aren’t using Boost or the standard library have usually done so and reached that conclusion — perhaps you will too, and perhaps not.

Edit Coming Back to This Question After A Few Years
Having continued to use more and more boost libraries, I thought I’d update this question to give a solid case for why you should use boost when the description of the product matches your desired functionality. This will convince even nay-sayers. Download openSSL, try to make a client and server application with it. Now try and make that work on every platform. Then, download and use boost::asio::ssl to make the same application. If you’re not convinced that boost is the right place to look for clean, well optimized, peer reviewed, cross-platform code, this simple exercise will convert you.

Tl;dr version:

In my opinion, you don’t see a ton of indie or small to mid size development firms using boost because it’s a massive and powerful wild beast that isn’t easy to tame and you’re basically on your own when trying to learn how to use it. The documentation is lacking in a few ways (see long version) and “the community” around the project either seems to be missing, scattered or inactive (compared to other projects).

Very Long Winded Version:

I realize there is already an accepted answer but as someone who actually uses boost in nearly every project I do, I thought I’d post an answer.

I remember when I first got poking around in boost and honestly I had no frigging idea what was happening. Boost is not very well documented at all. People might disagree with me on that I’m sure because there are tons of snippets of example code and a comments and such, but it is all very cold and vague as well as difficult to navigate.

Also it seems difficult to find any place where you feel like you’ve found “the community” around the project. In fact the community seems non-existent, or nomadic. Unfortunately even their mailing list has been trolled by so many leech sites that you can go down this rabbit hole always looping back around to where you started.

These two factors make learning to use boost libraries a rather daunting task. Even if the technicalities of using boost aren’t excessively complex, it is a massive set of libraries and staring it down when all you’re armed with is a few code snippets and scattered pieces of the mailing list from the darkest corners of the internet… well you get the idea.

I got into tinkering with boost around version 1.45 and it’s only now in version 1.52/1.53 that I feel comfortable enough to use it in production. There are so many things to get used to and remember, even simple things like how you’ve configured boost and remembering that configuration, because how the libraries are built and function can vary wildly based on your preferences at compile time due to how customizable things are.

However, make no mistake, once you can wield boost, you’ve gained a powerful weapon for rapidly building solid, cross-platform programs. Just take boost::asio for example. You can write an immensely powerful, scalable and rock solid cross platform asynchronous web server in just a couple hundred lines. I’ve written multiple clients, servers, proxies etc over the years with just a few hundred lines of code each that have yet to fail me, and can port them from platform to platform in minutes.

As others have pointed out, larger companies are usually stuck with legacy stuff or like to roll their own which I completely understand. There is also this really silly thing I’ve heard of and encountered where dev leads and or project managers forbid using boost because it’s “too big”. My guess is that they believe that boost is 1 single library or they’ve never heard of BCP.

As for WHY I choose to use boost

I’d say I use it because as you imply in your question, it’s “the” C++ library. Boost is viewed in the C++ world as the swiss army knife of things that eventually you’re going to need to use. So the idea is that if there is a need, there should be a highly performant, and portable version of it in boost. Big companies contribute to boost, very educated people with impressive resumes contribute and maintain it, and when a new standard of C++ is being developed, people usually look to boost to see what parts of it should become ISO standardized C++.

So if I need to add some functionality that there is probably an existing library for, the first place I’ll look is boost just because I’m pretty safe in betting that it’s pretty well optimized, portable, it will be supported and maintained for a very long time and bugs will be found and dealt with. In the open source world those qualities can be very difficult to come by.

We used a bit of Boost back at our old workplace. The main reasons for mostly avoiding it and limiting its use were:

  • compile times – some of it is very slow to compile, and you end up being reluctant to have boost #includes in any of your headers
  • complexity – it’s not well known by most game developers and so makes for unreadable code
  • performance – some of the concepts perform slowly by default, eg. shared_ptr

Related Solutions

Extract file from docker image?

You can extract files from an image with the following commands: docker create $image # returns container ID docker cp $container_id:$source_path $destination_path docker rm $container_id According to the docker create documentation, this doesn't run the...

Transfer files using scp: permission denied

Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:...

What’s the purpose of DH Parameters?

What exactly is the purpose of these DH Parameters? These parameters define how OpenSSL performs the Diffie-Hellman (DH) key-exchange. As you stated correctly they include a field prime p and a generator g. The purpose of the availability to customize these...

How to rsync multiple source folders

You can pass multiple source arguments. rsync -a /etc/fstab /home/user/download bkp This creates bkp/fstab and bkp/download, like the separate commands you gave. It may be desirable to preserve the source structure instead. To do this, use / as the source and...

Benefits of Structured Logging vs basic logging

There are two fundamental advances with the structured approach that can't be emulated using text logs without (sometimes extreme levels of) additional effort. Event Types When you write two events with log4net like: log.Debug("Disk quota {0} exceeded by user...

Interfaces vs Types in TypeScript

2019 Update The current answers and the official documentation are outdated. And for those new to TypeScript, the terminology used isn't clear without examples. Below is a list of up-to-date differences. 1. Objects / Functions Both can be used to describe the...

Get total as you type with added column (append) using jQuery

One issue if that the newly-added column id's are missing the id number. If you look at the id, it only shows "price-", when it should probably be "price-2-1", since the original ones are "price-1", and the original ones should probably be something like...

Determining if a file is a hard link or symbolic link?

Jim's answer explains how to test for a symlink: by using test's -L test. But testing for a "hard link" is, well, strictly speaking not what you want. Hard links work because of how Unix handles files: each file is represented by a single inode. Then a single...

How to restrict a Google search to results of a specific language?

You can do that using the advanced search options: http://www.googleguide.com/sharpening_queries.html I also found this, which might work for you: http://www.searchenginejournal.com/how-to-see-google-search-results-for-other-locations/25203/ Just wanted to add...

Random map generation

Among the many other related questions on the site, there's an often linked article for map generation: Polygonal Map Generation for Games you can glean some good strategies from that article, but it can't really be used as is. While not a tutorial, there's an...

How to prettyprint a JSON file?

The json module already implements some basic pretty printing in the dump and dumps functions, with the indent parameter that specifies how many spaces to indent by: >>> import json >>> >>> your_json = '["foo", {"bar":["baz", null,...

How can I avoid the battery charging when connected via USB?

I have an Android 4.0.3 phone without root access so can't test any of this but let me point you to /sys/class/power_supply/battery/ which gives some info/control over charging issues. In particular there is charging_enabled which gives the current state (0 not...

How to transform given dataset in python? [closed]

From your expected result, it appears that each "group" is based on contiguous id values. For this, you can use the compare-cumsum-groupby pattern, and then use agg to get the min and max values. # Sample data. df = pd.DataFrame( {'id': [1, 2, 2, 2, 2, 2, 1, 1,...

Output of the following C++ Program [closed]

It works exactly like this non-recursive translation: int func_0() { return 2; } int func_1() { return 3; } int func_2() { return func_1() + func_0(); } // Returns 3 + 2 = 5 int func_3() { return func_2() + func_1(); } // Returns 5 + 3 = 8 int func_4() { return...

Making a circle out of . (periods) [closed]

Here's the maths and even an example program in C: http://pixwiki.bafsoft.com/mags/5/articles/circle/sincos.htm (link no longer exists). And position: absolute, left and top will let you draw: http://www.w3.org/TR/CSS2/visuren.html#choose-position Any further...

Should I use a code converter (Python to C++)?

Generally it's an awful way to write code, and does not guarantee that it will be any faster. Things which are simple and fast in one language can be complex and slow in another. You're better off either learning how to write fast Python code or learning C++...

tkinter: cannot concatenate ‘str’ and ‘float’ objects

This one line is more than enough to cause the problem: text="რეგულარი >> "+2.23+ 'GEL' 2.23 is a floating-point value; 'GEL' is a string. What does it mean to add an arithmetic value and a string of letters? If you want the string label 'რეგულარი...