To STL or not to STL

W

WW

Mike said:
A colloquialism (I don't know the origin). Referring to
something or someone considered undesirable, "I wouln't
touch that with a ten-foot-pole." Meaning essentially
"I would not touch that, or even go within ten feet of it."
(about three metres to you. :))

Ah, OK. It is like the bone on the neck thing, then. :)
 
C

Christopher Benson-Manica

What does that mean?

Heh... in English, there is a phrase "I wouldn't touch ____ with a ten-foot
pole," meaning one wishes to stay as far away from ___ (whether ___ is a
particularly nasty person, situation, a grizzly bear, or MFC). FWIW, if I had
a ten-foot pole, I'd probably use it to bludgeon Bill Gates ;)
 
J

jeffc

Allan Bruce said:
Hi there,

I am interested to know if there are any C++ programmers who do not use STL.
I have been coding in C++ for a year or so now, although only recently have
I started a large(ish)-scale project. I do not use any STL, and I was
wondering if there are any others out there that program in C++ without
using STL? (Just to see if I am being stupid by not using it)

Well, I think I'd get pretty tired of constantly reinventing the wheel.
Depending on the project I've used Microsoft MFC, or Rogue Wave library, or
STL, etc. So if you don't use STL, I hope you're at *least* using *some*
library that at *least* gives you a string :)
 
J

jeffc

Moonlit said:
I have never encountered a bug in the STL (and I use it all the time).

Isn't that kind of like saying you've never encountered a bug in the C++
language?
 
M

Moonlit

Hi,

jeffc said:
Isn't that kind of like saying you've never encountered a bug in the C++
language?


Nope!

That's kind of saying I never encountered a bug in the STL (as I said).

Still, I didn't say there isn't any bug in the STL, I just say I haven't
encountered any, despite I have used it for many years.

Ok, at some time hash_map's didn't seem to be supported by the g++ compiler,
you can still download the files from sgi


Regards, Ron AF Greve.
 
S

Samuel Barber

Ron Natalie said:
Yes you are. If there is a feature supported by the library, you're better
off using it than rolling your own. They make things much simpler. For
example, vector and string both have reasonable copy/assignment/destruction
behavior which means you don't have to sit there managing memory with new and
delete.

Read up on "move constructors" and you might change your opinion of
what is reasonable behavior.

Sam
 
R

Ron Natalie

Moonlit said:
Ok, at some time hash_map's didn't seem to be supported by the g++ compiler,
you can still download the files from sgi
hash-maps are NOT part of the C++ standard library.

I've encountered bugs in the STL, but as of late, I've been able to live with them.
 
R

Ron Natalie

Samuel Barber said:
Read up on "move constructors" and you might change your opinion of
what is reasonable behavior.

That's a different issue. I'm talking about the copying and destruction of the
container itself (rather than the contained object).
 
M

Moonlit

Ron Natalie said:
hash-maps are NOT part of the C++ standard library.

100% percent correct. That's why I said you can still download them from
SGI.

At one time they where supported by the g++ compiler. If you think you are
not able to compile your old code you can still download them from the SGI
site.

Apart from that there really is no reason to NOT use the STL. The code is
faster than you write it yourself (if you have something even faster post it
here, please!) not to mention it takes very little effort to write. Just
follow the postings in this newsgroup and you know that if you would like to
use C++ you sure want to use the STL.


Regards, Ron AF Greve
 
S

Samuel Barber

Ron Natalie said:
That's a different issue. I'm talking about the copying and destruction of the
container itself (rather than the contained object).

What's so wonderful about that? Usually, programmers go to great
lengths to avoid copying containers. C++ makes it all too easy to
write elegant code which is grossly inefficient, due to implicit
copying of large objects.

Sam
 
T

Tõnu Aas

Yes you are. If there is a feature supported by the library,
you're better
What's so wonderful about that? Usually, programmers go to great
lengths to avoid copying containers. C++ makes it all too easy to
write elegant code which is grossly inefficient, due to implicit
copying of large objects.
? > What makes you think his reinvented wheel is better?

There are so many "wheel inventers". Ask yourself why.
And the best answer is: "STL makes it too easy to write elegant code which
is grossly inefficient" (not C++)

So are people inventing "wheels" like intrusive containers and so on.
Its strange that programmers are so happy with STL and just buy new computer
and
add xxxGB memory into it.

Second myth - portability - isnt so good also. If you live on windows
plaform only, then its o.k.,
but if you are not using main path, then you are in trouble.

Tõnu.
 
K

Karl Heinz Buchegger

Moonlit said:
Hi,



Nope!

That's kind of saying I never encountered a bug in the STL (as I said).

jeffc ment: You didn't encounter a bug in the 'STL implementation you use'.
 
M

Moonlit

Hi,

Karl Heinz Buchegger said:
jeffc ment: You didn't encounter a bug in the 'STL implementation you use'.
What I meant with that sentence is; That if you write your own code, which
would implement the same functionality, you likely would spend a lot of time
debugging (unless you are some miracle coder of course). Since the STL is
already used by so many people it has been thoroughly tested (of course this
is true for any piece of code that is used by many people). I didn't say
there are no bugs in any implementation, I just say I didn't encountered any
and use it a lot mostly g++ but in VC++ too.

Regards, Ron AF Greve

 
K

Karl Heinz Buchegger

Moonlit said:
What I meant with that sentence is; That if you write your own code, which
would implement the same functionality, you likely would spend a lot of time
debugging (unless you are some miracle coder of course). Since the STL is
already used by so many people it has been thoroughly tested (of course this
is true for any piece of code that is used by many people). I didn't say
there are no bugs in any implementation, I just say I didn't encountered any
and use it a lot mostly g++ but in VC++ too.

You didn't get it.
The STL, just like C++, is just a specification. Of course you can't
find bugs in it. You may find inconsitencies in the descriptions of
what the functions and objects should do, but certainly not bugs.
Bugs are reserved for implementations.
jeffc's argumentation is on the level of correct usage of english language.
 
M

Moonlit

Karl Heinz Buchegger said:
You didn't get it.
The STL, just like C++, is just a specification. Of course you can't
find bugs in it. You may find inconsitencies in the descriptions of
what the functions and objects should do, but certainly not bugs.
Bugs are reserved for implementations.
jeffc's argumentation is on the level of correct usage of english
language.

Nope you don't get it. The abbreviation also referres to any STL
implementation as well. And if you see them I am talking about bugs you
should have known that I was referring to any STL implementation.

If you donwload the standard template library from the sgi site, you are not
downloading the specs but the implementation.

Period.

Regards, Ron AF Greve.
 
K

Karl Heinz Buchegger

Nope you don't get it. The abbreviation also referres to any STL
implementation as well. And if you see them I am talking about bugs you
should have known that I was referring to any STL implementation.

Interesting.
So when saying: You didn't find any bugs in the STL, you are referring
to any (but no specific) STL implementation.
If you donwload the standard template library from the sgi site, you are not
downloading the specs but the implementation.

I am downloading a specific STL. But unless I mention which one
in specific, the phrase 'bugs in STL' has no meaning.

'I found some bugs in sgi's implementation of STL' has a meaning

'I found no bugs in Dinkumware's STL' has a meaning

'I didn't find bugs in all STL implementations I used up to know' has a meaning

'I found a bug in the STL' has *no* meaning. What is *THE STL*? Who made it?
Where can I get more information about that? *The STL* is just a stack of papers.
 
J

jeffc

Moonlit said:
Nope!

That's kind of saying I never encountered a bug in the STL (as I said).

Still, I didn't say there isn't any bug in the STL, I just say I haven't
encountered any, despite I have used it for many years.

No, you haven't used the "STL", you've used a particular implementation of
it. That's *like* saying you've used a particular implementation of C++.
People don't find bugs in C++, they find bugs in C++ compilers.
 
J

jeffc

Moonlit said:
Nope you don't get it. The abbreviation also referres to any STL
implementation as well. And if you see them I am talking about bugs you
should have known that I was referring to any STL implementation.

Your statement that you haven't found any bugs in STL is meaningless unless
you've used every STL implementation. It's like saying you've never found
any bugs in C++ and oh by the way, you've written programs only for the
Bombastic 2000 compiler. It doesn't make any sense. What you mean is you
haven't found any bugs in g++ or VC++, although you haven't used VC++ much.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top