Boost/STL in games?

Started by
44 comments, last by Shinkage 18 years ago
Quote:Original post by Anonymous Poster
One good reason to use the stl is by simply typing "std::vector" you now have a fully functional dynamic array.

And then you could have so called object leak problem. Out of memory error isn't nice thing. Not to mention in many situations you doesn't need an general purpose RESIZABLE array.
Advertisement
Quote:Original post by Christer Ericson
Quote:Original post by johnnyk
Do the Boost and STL libraries have a place in console games?

I think it's safe to say they're frowned upon because they are over-engineered, have difficult-to-predict memory behaviors, and give obscure compiler errors that do not facilitate easy debugging.


Nice summary.

Quote:An interesting example can be taken from Dave Eberly's 3D Game Engine Architecture, where Dave compares implementations for a Set from STL and a smaller more compact Set class (SmallSet to be exact).

if i remember correctly Dave Eberly also posted here as well only to be told to bugger off, as he doesnt know the true power of stl [ shitstiring mode off :) ]
Quote:Original post by zedzeek
Quote:An interesting example can be taken from Dave Eberly's 3D Game Engine Architecture, where Dave compares implementations for a Set from STL and a smaller more compact Set class (SmallSet to be exact).

if i remember correctly Dave Eberly also posted here as well only to be told to bugger off, as he doesnt know the true power of stl [ shitstiring mode off :) ]


:D

I'm more than happy to listen to arguments backed by reasoning.

Raghar is a fantastic case in point of the opposite.

I believe Mauling Monkey has given a very good summary of the usefulness of he STL. Just to reiterate it doesn't do everything (else why would Boost et al exist?). What it does do is give you a nice set of functionality for free if you take the time to discover what you can do with it. Obviously there are issues (such as compilers, mentioning no names *cough*) but they aren't unpassable and are certainly a heck of a lot more fun than learning some other companies way of doing things... every time you move jobs or change engine.
Quote:Original post by zedzeek
Quote:An interesting example can be taken from Dave Eberly's 3D Game Engine Architecture, where Dave compares implementations for a Set from STL and a smaller more compact Set class (SmallSet to be exact).

if i remember correctly Dave Eberly also posted here as well only to be told to bugger off, as he doesnt know the true power of stl [ shitstiring mode off :) ]


And a quick google shows it to be in a conversation which I remember reading, a good debate! He posted in here, although that's hardly how I'd describe the replies to him. IMHO, however, the arguments he presented in his example case were not terribly strong (see some of SiCranes replies in that thread, especially this summary one if you're lazy).
I think a lot of people who are arguing against the use of STL are picking conveniently inappropriate examples. Obviously, std::set is not going to be optimal for a tight memory budget, because of its general purpose nature and the way it handles collections. I've seen no argument as to why some of the more basic bits of STL or boost shouldn't be used as a solid base on which you can build a more specialized utility library. Just as a few examples, I can see no objection to using std::string, std::vector, std::pair, boost::pool, boost::compressed_pair, boost::dynamic_bitset, and the list goes on. I think the reason peopole are objecting so vehemently to Christer's original statementis that his claim was that STL was entirely useless, essentially because of the overhead incurred by its general purpose nature. While I don't think anybody will disagree that some parts of STL are certainly ill suited to console programming, there are still some very functional and lightweight classes in there which can be used as a time tested base on which to build a more specialized utility library.

This topic is closed to new replies.

Advertisement