"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."
No it does not. You're doing the "assume god before proving god" thing. Std
C++ is not easy to read. But it can be. So I am saying that the style makes
more difference than the language. I think you may be saying that because
the common use of the language is cryptic, that is acceptable. I've had long
time Cobol programmers see my code and say: "that's easy! I can do that!".
It wasn't C++. It was my API or stylistic usage of the tool that could
grasp. All the details were hidden. Without going too far into hypothetical
land, there's a goodness aspect of computer language design in regards to
usage that is lacking with the concept (or just implementation?) of a "close
to the machine", "GP" language.
"If you're just working in a vacuum, for your own
pleasure, it doesn't matter."
But that's not true either: you're assuming some global coding style and
that does not exist. And just specifying the language is less important than
the "how" it is used. Your statement above is extreme. There is an entire
range of possibility between using an API written in C++ and having no rhyme
or reason/starting from scratch. I can't help but think you are on the
"start from scratch" position and that you feel that "have C++ std, will
travel" is adequate. Note that I say that is woefully inadequate. The C++
std doesn't even get one to level zero. There is SO much to be built before
you can even create a program: tooling up is necessary.
" 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"
But that doesn't exist. Not at the level you suggest: that C++ std is that
thing. It's not. It's trees vs. paper. (Well maybe if you have Birch bark).
"---if there is a standard"
"IF" is the keyword in that statement.
"solution, then you should only do something else if there are
very powerful reasons for not using the standard."
Now you're arguing the std lib? That's such a small part of it. And using it
ties software to C++ more tightly than desireable (You don't think C++ is
the end do you? I'd say it's now obsolete for new development, save for that
quite obviously better language even largely based upon 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."
OK, but you didn't prune enough context to let me remember my thought. Hang
on... OK. Surely I meant that STL and the std lib is no better than any
other proven lib. You can only use time as a quality-producing measure at
the beginning of a development. It is a much used general "argument" though.
It has no teeth. Evolve something else in house or across a commercial
ecosystem and it will be better for a given use or for a given team (that's
your scenario), or a given software house or a given shrink-wrap house...
see what I'm saying? It's not just containers and algos and iterators. Other
things are directly related. Do you really want to suggest that some
homogenous "std" library is ideal? You have to look at the software
development environment: you're hoping for plug-n-play team members on SW
dev projects, but I assure you that it does not exist at the language level
and shouldn't. I can go on, but you get my point.
" If it's standard, it's not
house specific---a new hire won't be familiar with anything
that's house specific. "
See, you're dismissing the product-producing software or solution provider
in favor of low level technical detail. You may do it that way, teach
deliverable team members std C++ and such, I've done that, I aspire to
deliver shrink wrap. (I already do, but only to my consulting clients who
just want it done and use my software daily without even knowing it). I'm
solution focused rather than technology focused. I'm aspiring to get to a
higher level of solution and plugging away almost daily at my codebase. I'm
to the level now that I'm chomping at the bit of specifying and implementing
(latter is harder) my own language. Not just DSL either (it's mostly why I'm
on USENET again: R&D).
"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."
Again, I know that is too low level to be "standard". So I've said the ISO
committee should get out of the library business. A reference implementation
is all good. But a centralized implementation unextricable from the
paradigms of C++? No thank you. I consider that "boiling in oil" tactic. If
you want to talk standardization, I think you have to talk least common
denominator as a starting point.
"In all cases, it's a question of price/benefits:"
Don't forget the time component: short term vs. long term. Is it a
"consultancy" project team? A solution provider? A shrinkwrap software
house? These are all very different environments that can and should use C++
in different ways if they use C++ and THE AMOUNT OF TOOLING UP they do
before starting. C++ is not a tool. It's something to build tools from. It's
iron ore, rather than a sword.
" 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."
That's not true. You're assuming an environment of use.
"In most cases, however, the standard
library is good enough,"
That's unproven rhetoric. Being first to market doesn't ensure being best at
anything.
" and since anyone who claims knowledge of
C++ should be familiar with it, it's the way to go."
That's not true either. Style, API and tooling up are much more important
than language. Architecture, design...
" In special
cases, however, there may be justification for something
different"
No, I disagree: as we know with C and C++, standards in languages and
libraries are stifling. New development is stifled by a standard that is
unnecessarily (for the scenario) "backward compatible. You know what it is
akin to? Putting code into the source control system too early. That is
indeed the C/C++ legacy. Trying to be a standard before it's even in
puberty.
" : 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)."
That's quite micro-level thought. It's important, but not in the outer
scope. Sure, someone has to "twiddle bits". If there is nothing beyond that
in a project, plan or argument, well, it's pretty much the Lord of the Flies
scenario.
Tony