quote:Original post by CGameProgrammer
I can see the appeal of using STL if you haven''t already written your own classes for the basics, but I have, and haven''t ever learned STL, though I recently bought Game Programming Gems which has chapters on it (or maybe I''m thinking of some other recent book, I forget). But I still hate its syntax. I thinkstring buffer = "name: " + name + ", hp: " + hitPoints;
is better than the STL equivalent. But STL is designed to have a common interface for all objects - it wouldn''t look right writing data to a file using the + operator.
~CGameProgrammer( );<P>
The interface of STL is the smartest thing i''ve ever seen. Maybe its just me, but when I look at Mona Lisa i see a painting; when I look at the STL i see artistry
You could (given you already know how to code in C++) learn enough of the STL in 30 minutes to be productive with it.
Heck just knowing this:
vector<int> a;
....
sort (a.begin(), a.end());
is good.
I dont use the full library. I''ve never used stable_partion, or partion for that matter. I''ve never written a custom allocator (well i did, but only for the knowledge/experience). I''ve only needed to write a handful of predicates, the ones supplied do just fine. I havent found much use out of set.
There are some things that will trip you up learning the STL because they seem very counter-intuitive like
stacks .pop() call doesnt return a value (still dont understand this
and remove doesnt really remove things (hard to explain without a diagram
ptr_fun and there ilk are hard to understand at first.
Other than thoose small things, learning STL is so simple. No reason not to do it!