Z
zr
Q What are the disadvantages of using STL ?
Thanks in advance
Pallav Singh
Since no one mentioned it, what about code bloat? Is this still an
issue in recent implementations?
Q What are the disadvantages of using STL ?
Thanks in advance
Pallav Singh
I would use a combination of the Boost Intrusive containers and the
STL.
Boost Intrusive doesn't have anything like vector or deque so I'd use
those where it made sense. In places where there is a choice between
an STL container and a Boost Intrusive container, I'd favor using the
Boost Intrusive container.
"Hello Tony,"
No need to be formal (seesh).
"it seems you don't have a lot to contribute to this (or any?)
discussion."
Give to receive. (Or is that too a cliche?).
" I went through the trouble of reading all your posts in
this thread and the thread "C++ is complicated" again and the only
things that have stuck are:"
("only", as if you are omniscient).
"* STL is supposedly complicated."
I said "obfuscated", didn't I?
" It's more complicated than your container library."
From an implementation standpoint, yes. (You're not talking about design
outside of the language/syntax domain are you?) Think about it this way:
why
would I have created and evolved something else if I thought STL was "the
bomb"?
In many instances, even container choice makes little difference.
Personally, I use a container that fits the problem even if "a simple
array"
could do it more efficiently a lot of times. If I was developing genome
programs or such, I would probably choose the highest performing beast
available: STL (template-based gives high perf).
I think that the concept of
one library that would span the needs of a programmer that needs to
develop
utility programs in adjunct to network/system administration, to the
scientific programmer, a non-practical idea. Rogue-Wave and Borland both
went to "enterprise development". Did they "cave in" because of the C++
std
library? I know how companies evolve. And when the substance walks out the
door (and gets "let go"), the company stagnates to a period of
inter-management boom ("enterprise" sounds kinda fitting huh?).
You're a bit behind the current times though apparently: you are saying
that
if one uses C++, then the std C++ library is the way to go. I don't think
C++ is the way to go and haven't for quite awhile. It has been a great
learning experience, but times have changed.
Noah Roberts said:Obviously, nobody saying the STL is a useful tool nor that it exhibits
good design are saying it's the only C++ library that does, nor that it's
necessarily the best thing out there. I've yet to see a single argument
from those who are claiming it's, "too complex," that isn't some variation
of, "I looked at my compiler's implementation and didn't understand it."
A lot of the boost stuff takes the ideas of STL and expands on them. Some
more than others. People complaining about the STL won't be impressed by
what they find in boost at all.
For one thing, the amount of hacks that have to go into boost in order to
make it compatible with non-standard compliant but important compilers is
formidable in many cases. For another thing, without some familiarity, or
at least willingness to become familiar, with these "academic" methods of
design and implementation that people are complaining about, boost is
completely undecipherable.
It's never been a problem for me. If you do find that your performance
is suffering because of unnecessary icache misses, there are
straight-forward techniques to address the problem. (I've heard the old
technique of partially specializing for all raw pointer types, then
wrapping a non-template implementation that only uses void*, referred to
as "hoisting.")
It's never been a problem for me.
If you do find that your performance is suffering because of
unnecessary icache misses, there are straight-forward
techniques to address the problem. (I've heard the old
technique of partially specializing for all raw pointer types,
then wrapping a non-template implementation that only uses
void*, referred to as "hoisting.")
Some of us have too much invested in blood, sweat and tears to divulge any
patentable thing or trade secret at the source code level. You said
"software" and "mature". Did you mean "source code"?
Think about it this
way: given what is commonly known (the std library), and using that as just
a starting point, shouldn't you be considering that the std library is
"obsolete" given that many private, commercial and independent researches
have built or are building something else?
" I once thought the
STL was "the bomb," but have changed my mind now. In a number of
ways the containers in the Boost Intrusive library are better than
the STL. Anyway, your talk of another approach without giving much
detail or publishing anything doesn't work for me."
Understood. I wasn't selling my approach/architecture/designs nor divulging
them. If it comes out sometimes, it's because it's where my mind is at and
what I'm doing (or if I'm in the groups I'm procrastinating, needing
sebatical or something similar...).
"I would use a combination of the Boost Intrusive containers and the
STL."
Everytime I visit the Boost site, I don't leave with anything that sticks in
my mind. They must be tailoring to "rocket scientific programming" or
something. (?). (rhetorical, start a new thread if you wanna promote/discuss
Boost).
"Boost Intrusive doesn't have anything like vector or deque so I'd use
those where it made sense. In places where there is a choice between
an STL container and a Boost Intrusive container, I'd favor using the
Boost Intrusive container."
It's been a long time since I've searched for commercial alternative
libraries (when it was just containers/iterators/algos it was easy?).
"What do you suggest? Do tell."
The preceding sentence of mine applies: search on the web for commercial
products, open source tends to have other agenda. You get what you pay for!
Some of us have too much invested in blood, sweat and tears to divulge any
patentable thing or trade secret at the source code level. You said
"software" and "mature". Did you mean "source code"?
Think about it this
way: given what is commonly known (the std library), and using that as
just
a starting point, shouldn't you be considering that the std library is
"obsolete" given that many private, commercial and independent researches
have built or are building something else?
"Boost Intrusive doesn't have anything like vector or deque so I'd use
those where it made sense. In places where there is a choice between
an STL container and a Boost Intrusive container, I'd favor using the
Boost Intrusive container."
It's been a long time since I've searched for commercial alternative
libraries (when it was just containers/iterators/algos it was easy?).
"What do you suggest? Do tell."
The preceding sentence of mine applies: search on the web for commercial
products, open source tends to have other agenda. You get what you pay
for!
It's sometimes clumsy in a multithreaded environment.Pallav said:Q What are the disadvantages of using STL ?
The STL was designed originally by Alex Stepanov, not by
committee. Anyway, that's not a meaningful answer, just a
cliche that reiterates your opinion that standardization is
inherently detrimental. Are you saying that your dislike of
STL is more philosophical than technical?
It's never been a problem for me.
If you do find that your performance is suffering because of
unnecessary icache misses, there are straight-forward
techniques to address the problem. (I've heard the old
technique of partially specializing for all raw pointer types,
then wrapping a non-template implementation that only uses
void*, referred to as "hoisting.")
Jeff Schwab said:Did you reply to the wrong post?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.