Tony skrev:
"Noah Roberts" <ro**********@g mail.comwrote in message
news:11******** *************@7 3g2000cwn.googl egroups.com...
Tony wrote:
How much bloat does the STL produce? Is it a good design
wrt code bloat? Do implementations vary much?
In general STL containers and algorithms are made to introduce little
bloat and overhead. They are usually very well optimized for the
compiler they are built for. They also increase programmer
productivity by a great margin. Unless you see a problem with a
particular use of an STL container or algorithm it is just plain silly
to concern yourself with such. It is very difficult to beat the usual
STL implementation in size, speed, quality, or dependency.
Its readability sucks rocks though. Where would one go to read about
STL memory management design/architecture if anywhere?
What do you mean when you say readability sucks? If you read the
standard C++ code from e.g. Dinkumware I agree that the code is not
that easy to read, but you should bear in mind that the code has been
written to be ported to different compilers in several configurations.
Also e.g. variable names look weird, but remember that the code must be
able to work in "hostile" environments where the programmers might e.g.
have definitions such as
#define i 42
.... none of the template code you or I write could handle stuff like
this (nor are we supposed to).
If you think readability of code using the standard library, i believe
that the code in general is quite readable.
Now If you want to learn something about your standard library, I would
recommend that you simply study the code - preferably while debugging
it. You could also try to write your own collection classes.
/Peter
[snip]