Malcolm said:
When STL first came out I thought that maybe it was the end of C. The STL
containers did provide runtime performance and encapsulation that you had
to handtune C to match. But actually the result was the reverse. I think
it was because STL made the syntax for just declaring an array and
stepping through it too cumbersome.
Could you provide an example where you demonstrate how declaring an array
and iterating through it is "too cumbersome"?
That was the point at whcih people
stopped switching from C to C++, and started moving from C++ to other
languages.
Is it a personal opinion or is there any basis for that assertion?
C++ had a huge user base behind it and is still a popular
language. But ever since STL it's been in decline.
The only time I ever heard of any real world complain regarding the STL was
from people involved in game programming, whose complaints were somewhere
between worries that some STL implementations might have efficiency issues
and ignorance on the programmer's behalf.[1] Other than this, I believe you
will be hard-pressed to find a C++ programmer who doesn't employ the STl in
his code.
I'm current programming
under Qt. However I've deliberately written all the non-GUI elements of
the program in C. Even the C++ elements aren't really C++, because Qt
preprocesses them to make the signals and slots mechanism work. C++
doesn't provide the flexiblity to do this natively.
Qt's signals and slots mechanismo is a particular implementation of the
observer pattern, and one which is notoriously inefficient and with a
particular ability of sweeping serious problems under the proverbial rug.
The only reason Qt relies on preprocessing tricks is basically for syntactic
sugar purposes,[2] not any lack of flexibility C++ might have. Meanwhile,
there are plenty of stand-alone implementations of the observer pattern
floating around that manage to do a better job, such as libsigc++.[3] So, I
believe it is safe to say that C++ does provide more than enough flexibility
to handle signals and slots natively. After all, if it didn't then Qt
wouldn't support them.
Rui Maciel
[1]
http://software.intel.com/en-us/articles/extending-stl-for-games/
[2]
http://doc.qt.nokia.com/4.7-snapshot/moc.html
[3]
http://libsigc.sourceforge.net/