P
Pallav singh
Q What are the disadvantages of using STL ?
Thanks in advance
Pallav Singh
Thanks in advance
Pallav Singh
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++The main disadvantage is that you need to learn those at least somewhat
before you can use them. All the other disadvantages pale in comparison.
V
Uh... MFC CMap, what?
Q What are the disadvantages of using STL ?
* Victor Bazarov:
It seems Pallav Singth thinks a that a similarity of names
means roughly equivalent functionality.
If it's true that MFC CMap is hash-based, then that is a hash
table, presumably without simple O(n) traversal of elements,
and certainly not in sorted order, but on the other hand
offering O(1) insertion and look-up -- a different trade-off
from the one in std::map, and used for different purposes.
Relative to what? The STL is imperfect, but I don't think
I've seen a better library of algorithms and containers.
MFC CMap (works much faster than STL map because STL implementation
is
tree-based while MFC one is hash-based).
Jeff said:What is this, a Zen koan? Every question met with a question? Better
in the sense that it's faster, more generic, and easier to use. When I
used the word, I was thinking of the old, intrusive containers used with
MFC, and of the Java collections framework.
Q What are the disadvantages of using STL ?
Thanks in advance
Pallav Singh
What is this, a Zen koan?
Every question met with a question? Better in the sense that
it's faster, more generic, and easier to use.
When I used the word, I was thinking of the old, intrusive
containers used with MFC, and of the Java collections
framework.
I thought it was "compared to *not* using it"... <g> I mean,
what is the alternative of "using"?
Pallav said:Q What are the disadvantages of using STL ?
Bart said:Compared to rolling your own, the disadvantages are that you don't
learn as much about implementing containers and algorithms.
Another disadvantage is that you don't have to spend so much time
hunting bugs.
Pallav singh said:Q What are the disadvantages of using STL ?
It encourages others to use the STL, furthering it's lifetime and even more
widespread use. The STL is WAY over thought and as a result unduly
complicated. When you need an 800 page book (Jossutis) to describe how to
use a library offering these services, you have clearly lost touch with
reality. It looks to me like the work of a group, a BIG group, of academics
has been grafted onto the work of a lone practicing programmer who defined
C. The end result is a nasty slurry.
Nonsense. Jossutis describes the STL and the other parts of the
standard library.
Generic Programming and the STL by Matt Austern is a very good book on
the STL. It
describes the STL in some 70 pages. Then the original paper that
described the
full STL was much smaller still. STL uses only 4 concepts and only 3
that you need
to understand to use it effectively. The STL was the work of one man,
an academic?
Yes, a mathematician! I guess that's why it can do so much with so few
basic concepts.
Jeff said:Well, I don't use them. When I had to use them, I wrapped them in
classes that implemented the relevant interfaces.
osmium said:When you need an 800 page book (Jossutis) to describe how to
use a library offering these services, you have clearly lost touch with
reality.
Victor said:Herein lies another disadvantage: you have to sift through an 800 page
book to figure out the simple stuff and realise you don't need to read
all of it to make use of the STL... Bummer!
Jeff said:Huh? No, sorry, I mean that I wrapped the elements, not the containers.
The STL doesn't require you to wrap anything, or derive from any
interface; it just requires you to support standard syntax. In
contrast, some of the older collection libraries, include MFC (IIRC),
required that any element to be stored in (say) an "array" collection
had to derive from an "array element" abstract class, and override
various member functions. I prefer the STL approach.
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.