Hi,
STL. It's fast to code, it is fast code.
A few reasons and examples from real life:
Even today just 1.5 hour before I would left work, a colleage came over he
had to figure out what records had been sent to another system. Now I'm
talking about millions of records. After figuring out that the first 30
characters for the where unique. I created a program with a set (this sorted
automatically so it can do a binary search), corrected headers and footers
in the file. I was finished with testing the program actually in 1.5 hours
(including the little research for uniqueness, creating the numbers file
etc.) Debugging time was nearly zero (ok, I forget about the headers at one
time). I was surprised about the speed myself since it had to do a lookup in
about 40 megabyte of data loaded in the set.
I have programmed in pure C and this would have taken a lot longer than
this.
I have never encountered a bug in the STL (and I use it all the time).
Sure, it does take a while before you get used to using it. But once you do
you will program faster than anyone in plain C. Not only that, I at
sometime, compared 20 lines of code almost entirely of STL stuff (with the
SGI hash_map) with someone else highly optimized C code of three pages long
(it performed the same function). I talked to him how much microseconds his
lookups took because I was very curious about that. The answer he gave was
nearly the same as I had (I believe it was something like 45 and 47), but I
am quite sure that coding 20 lines take less time than 3 pages of code not
to mention the latter takes more time to read and to debug.
At some time I had to maintain a program without manuals but with a lot of
code. I wondered how to get it up in case it would crash (management decided
no backups since the data was expendible). I read through the code, since
they used the STL a lot, this was reasonably to do. It would have been much
more difficult if I would have to dig through three times the code necessary
to acomplish the same without the STL.
Therefore I would say use and or learn STL, you will do yourself and others
a favor (and you look up to date with your C++ knowledge).
http://www.sgi.com/tech/stl/
Regards, Ron AF Greve