Re: To STL or not to?
On Oct 10, 10:10 pm, Stephan Rose <nos...@spammer.com> wrote:
I was just wondering what the general consensus is on STL these days.
It's the standard. You "assume" that every C++ programmer is
more or less familiar with it, in the same way that he is
familiar with other parts of the language.
I think that if I remember right, several years ago, most
people (if not everyone) I knew anyway stayed far away from
it.
A quality implementation requires a compiler which is close to
conformant. Several years ago, there were still a lot of
compilers missing major features, with the result that STL
implementations varied in their work arounds, and weren't
necessarily compatible. That's not the case today. (Although I
still occasionally have problems with Sun CC; the compiler has
finally become "pretty good", but both of the library
implementations delivered with it are "pretty bad"---partially,
I think, because they haven't been updated to reflect the
capabilities of the new compiler, but only partially.)
I then switched to C# for several years and didn't worry about it much,
but having switched back to more C++ work earlier this year, I was just
wondering about that. =)
One of my projects does make heavy use of various arrays where I am
currently using custom made classes for that purpose and here I was just
pondering if potentially STL may be a better idea.
The STL has one absolute advantage: it is standard. Anyone
coming into your project from elsewhere should be more or less
familiar with the interface to std::vector, etc. Where as he
will first have to learn your in house classes. The STL may not
be an example of good design, but it's good enough, and it's
standard, and that means that it should be used by default.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34