This is why game companies use C++. They've already reimplemented it internally and don't ever want to do that again.
Game companies generally use C++ because they need to interface with existing C and C++ library code (at least at the engine level). C++ also allows for various low-level optimizations when such things become necessary, such as resorting to inline assembler or stashing flag bits in pointers.
That's not to say that other languages aren't capable of these things, of course.
(I spent seven years working for EA, and I contributed to EASTL while I was there.)
Source: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n227... Differences between std STL and EASTL First, EASTL provides a set of containers, iterators, and algorithms that are identical in interface and behavior to std STL versions with one exception: allocators. EASTL has a different allocator specification which is simpler, more efficient, more flexible, and easier to use than std::allocator. Both std::…
Other nice additions are the fixed-sized containers (fixed_vector and friends) and the somewhat-enhanced string class (which adds things like sprintf() support).
I've missed all of these things greatly since leaving EA.
Right, they have a custom STL because they want to have their custom memory management.
Here's my experience. Whenever a C++ programmer uses the word performance, it's never to describe using template-based generic data structures. I do it and the performance is fine, but the hard-core C++ programmers seem to hate STL. Incidentally, I asked someone about memory management in an interview for a C++ position. He said he wrote his own memory manager (object pool, basically), and never even bothered to use…
EASTL is essentially the reaction of a bunch of hard-core C++ programmers who hated all of the other STL implementations.
This is why game companies use C++. They've already reimplemented it internally and don't ever want to do that again.
A surprisingly large number of companies have their own STL implementations from Investment Banks to Telecoms companies. Often because they're doing funky things (often related to memory allocation) which would be outright impossible to do in languages like Java or C#.
Not trying to argue with you, I'd just like to mention as a curiosity that you would be surprised by how much 'funky' stuff you can do in C#. It has pointers (not just references, but real C-style pointers), it can pin objects in the memory, etc. It's hidden from the sight of the regular programmer, but it's there and it's part of the language, none the less.
I wouldn't call myself an expert on vertex buffers, but IIRC the OpenGL API to load data into a buffer just takes a pointer to the data and a size, so requires that your data is contiguous in memory beforehand - so deque may not have been an option.
Agreed. But I can't think of any data structure that would offer you contiguous, order-preserving storage and O(1) insertions/deletions of arbitrary elements.
There are actually implementations of deque which can store elements contiguously: imagine a vector where the "first element" is placed in the middle of the vector, and push_{front,back} reallocate whenever either end is reached. It wastes more memory than the typical deque implementation, but the elements are contiguous.
Agreed. But I can't think of any data structure that would offer you contiguous, order-preserving storage and O(1) insertions/deletions of arbitrary elements.
There are actually implementations of deque which can store elements contiguously: imagine a vector where the "first element" is placed in the middle of the vector, and push_{front,back} reallocate whenever either end is reached. It wastes more memory than the typical deque implementation, but the elements are contiguous.
You still don't get O(1) insertions/deletions of arbitrary elements with this implementation.
Insertions and deletions at either end are O(1), but inserting/deleting in the middle is costly.