Re: disadvantages of using STL
On Mar 21, 11:40 am, "Tony" <t...@my.net> wrote:
"James Kanze" <james.ka...@gmail.com> wrote in message
news:d89f30c4-b1bc-45e2-8b24-a8e380d818e7@j39g2000yqn.googlegroups.com.=
...
"Faster and easier to use? [STL] ranks close to last among
the libraries I've used in that respect. More generic,
perhaps, although not always. On the other hand, it's far
more complete than any other library I've used, and it's
generally more orthogonal than most.
Most importantly, of course, it's standard."
That's least important IMO, especially if you mean it's ISO
rather than standard in general.
It depends on whether you want your code to be read by other
people or not. If you're just working in a vacuum, for your own
pleasure, it doesn't matter. If you're producing code in a
professional environment, where the code has to be reviewed, and
other people will have to maintain and modify it, using
something standard (in the sense of universally known and
understood) is an enormous advantage---if there is a standard
solution, then you should only do something else if there are
very powerful reasons for not using the standard.
"So you don't (usually) have to think about it."
In what other way than with any other package of containers
and algos, commercial or house-specific that one is used to
using?
I don't understand the question. If it's standard, it's not
house specific---a new hire won't be familiar with anything
that's house specific. If it's commercial, it depends---a lot
of our software is based on Posix, and we expect new hires to be
as familiar with Posix as with C++, for example. More
generally, if the "commercial" product is widely enough used
that you can reasonably require experience with it for new
hires, fine. In all cases, it's a question of price/benefits: I
can quite understand firms adopting wxWidgets or Qt, for
example, even though they probably can't expect every new hire
to be familiar with it---there is no truely "standard"
alternative, and the benefits of using an already written
library are enormous. In most cases, however, the standard
library is good enough, and since anyone who claims knowledge of
C++ should be familiar with it, it's the way to go. In special
cases, however, there may be justification for something
different: a numerics application will probably prefer an in
house matrix class to std::vector< std::vector< double > >
(although it would almost certainly use std::vector in the
implementation), and a text processing program will doubtlessly
have its own "text" class (certainly based on std::string,
unless the profiler says no later).
--
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