As frob mentioned you will find in certain cases that the motivation behind rewriting certain things (such as the STL or standard library) is related to needs specific to our industry.
High-level companies and individuals do it because they can write code that is faster, more suited to our needs, or both.
Electronic Arts explains the motivations behind EASTL
here.
I myself use my own CVector and CVectorPoD, which is optimized for plain-ol’-data objects that can be moved in large chunks at a time (in memory resizes etc.) instead of one-by-one.
I also use my own MemCmp, which behaves the same as std::memcmp (and performs the same), but I also have MemCmpF which saves cycles by returning only true or false (as apposed to -1, 0, or 1, which requires a per-byte scan once a discrepancy between the inputs is found).
So when you are rewriting specific functions or classes, it typically boils down to:
- Am I satisfying a specific need while retaining similar performance or better, or;
- Am I simply improving performance significantly?
Boost is something you definitely
do not want to use in your game projects.
In regards to
actual libraries, things get more complex.
I originally wrote all my image-loading routines for .BMP, .TGA, .GIF, .PNG, and .DDS, which was a good experience and fun to do, but finally recently decided to add support for every file format ever to exist by just using FreeImage.
I don’t regret taking the time to reinvent a few wheels at least temporarily. Reinventing wheels is a great way to get a hands-on understanding of how things work, and if everyone never reinvented wheels then technology would improve at a snail’s pace.
Additionally, the whole reason I started my engine was to make a physics engine. I did make a miniature one and it was used in a ??????????? (Bakugan Battle Brawlers) game for Activision, which was a nice experience, but it was very basic and I will be using Bullet and PhysX this time around.
Ultimately, you need to decide if using a 3rd-party library is worth it for you based on what it brings and how much you care about your own personal balance on time, but nothing stops you from trying to make the same thing if you are interested in trying to learn that type of technology first-hand.
Libraries help you get things done faster but simple things such as string-compares are good exercises and larger things such as physics engines really help you understand how complex systems work under-the-hood.
L. Spiro