c++ stl

J

James Kanze

You are free to fix any mistake that the article carries.

What's the point? If you want to cite something, it should at
least be an original source, which carries some weight.
 
O

osmium

MiB said:
Congratulations, folks. It took only three posts in this thread (OP,
my answer, and the riposte) to bazooka a beginner's request for
pointers to study material into a completely pointless vivisection of
the three letter acronym STL.

:)

Ah, yes, a very familiar problem.. But I looked back at the original post
and it says:

" ... but i actully dont know what stl really is (?)"

I find it hard to believe that in this day and age anyone would contrive an
acronym where the 'T' came from the word STandard; especially when there
used to be a particular meaning for STL. It would be as though someone came
up with a new language called COBOL. BTW, I think a language with such a
name would be DOA.

As near as I could tell, he wanted a link to an e-book, I don't know of one.
If he is willing to spend a few dollars, he will not do better than _The C++
Standard Library_ by Nicolai Josuttis.
 
P

Paul

Paavo Helde said:
To me it seems quite appropriate to abbreviate "C++ STandard Library" as
STL. Maybe this is because I was not actively involved with C++ in 90-ties
and have never seen Standard Template Library distributed as a separate
library. Most people doing C++ programming are interested in the current
C++ standard library and not in the historic library from two decades ago.
Bollocks , this is completely incorrect.
STL != std library.

If you chooose to think that way then that's your choice and you are
incorrect. Please do not try to imply everyone who chooses the *correct*
interpretation is incorrect because they disagree with *your*
interpretation.
 
P

Paul

James Kanze said:
Pete Becker wrote:
MiB is correct, but note that many people use "STL" to refer
to the C++ STandard Library.
The C++ standard library encompasses a bit more components
than the STL[1]. If "many people" refer to the C++'s standard
library as "STL" then "many people" are making a mistake.
The C++ standard library is largely a "template" library.
I think of it as three parts: the C library (which is a quite large
part!), the parts from (or compatible with) the original STL
(containers, iterators and algorithms), and some other stuff
(iostreams, locales, possibly std::string ...).
Personally, when I say STL (which is rarely) I mean the second part.
You'd never hear me claim std::printf is part of the STL.

Good point. The T in STL means template, so STL really
shouldn't refer to anything that isn't a template. For most
people I talk to, STL doesn't include the C library, and it
doesn't include some of the language support either (e.g. the
operator new functions, or the standard exceptions). And for
almost everyone, it does include the parts of Stepanov's library
which were included in the standard. Where the meaning varies
is whether additional templates in the standard library (e.g.
std::basic_string, or the iostreams or the locale stuff) is part
of STL or not, and for some people, whether parts of Stepanov's
library that didn't make it into the standard (like slist), or
templates which have since been added to Stepanov's library
(like rope or hash_map) are part of the STL. Usage varies, so
if you want to be precise, it's best to avoid the term.

--
You are actually seeing some sense on this I am glad to observe.
Apparently if it is part of the std lib and it contains templates then its
STL, I guess, now.
 
J

James Kanze

Bollocks , this is completely incorrect.

Who says so? Who even has the authority to say so? Language is
based on common usage; if everyone agrees that X means Y, then X
means Y. If not everyone agrees, then X is ambiguous. (Within
a given community, of course. When talking about C++,
"template" means something quite different than what a secretary
dealing with Word would understand.)

The issue is communicating, and redefining a term with your own
meaning doesn't improve communications. Thus, the meaning I
personally prefer for STL is the one Rui is arguing for, *but*
the meaning I personally prefer is really irrelevant; what
counts is how people use and understand the term in the
community I'm addressing. In the case of STL, that meaning is
ambiguous, so I avoid the term, speaking either of the standard
library, or Stepanov's original library.
 
J

James Kanze

Ah, yes, a very familiar problem.. But I looked back at the original post
and it says:
" ... but i actully dont know what stl really is (?)"
I find it hard to believe that in this day and age anyone would contrive an
acronym where the 'T' came from the word STandard; especially when there
used to be a particular meaning for STL. It would be as though someone came
up with a new language called COBOL. BTW, I think a language with such a
name would be DOA.

The problem is that S does mean "standard", in all of the
accepted interpretations. And the word "standard" is ambiguous;
it can refer to an ISO standard, but it can also mean a de facto
standard, the "standard" way of doing something. One can argue
that Stepanov was a bit pretentious in naming his library, but
if he'd called it Stepanov's Template Library, we'd still be
having the same argument (and he certainly wasn't thinking
standard in terms of ISO when he named it).
As near as I could tell, he wanted a link to an e-book, I
don't know of one. If he is willing to spend a few dollars,
he will not do better than _The C++ Standard Library_ by
Nicolai Josuttis.

Again, it depends on what he actually means by STL. I don't
think one book will do the trick. Josuttis is by far the best
reference for the entire standard library, but if he's really
interested in the ideas behind the part taken from Stepanov
(what most "older" people think of as the STL), then Matt
Austern's _Generic Programming and the STL_ would seem
indicated.
 
R

Rui Maciel

James said:
The acronym doesn't have an exact meaning for those who wish to
communicate precisely with other people.

Yes, it does. It's the thing's name. It's a label that is used to refer
to a set of associated concepts. A label only fails to have a meaning to
those who don't know and failed to learn it's meaning. Therefore, those
who claim that the acronym for "Standard Template Library" doesn't have an
exact meaning simply don't know what they are talking about, and therefore
their opinion on it's meaning is worth just that.

There's no should in it. There's nobody who is making immutable
laws---even in French, the academie française can't stop the
evolution of language. It's just a fact of life.

You are trying to intellectualize and explain a failure to understand a
specific topic with appeals to the mutability of any languguage. It's
silly and disingenuous. No one can come here and claim that STL actually
means "super terrific library" or "strings, templates and lists" and then
proceed to try to defend that nonsense by claiming that, well, "you can't
stop the evolution of language".

They know their meaning, just as well as you know yours.

If someone wastes bandwidth with claims that "STL means STandard Library"
then that person is both ignorant and a troll.

They might not have learned what it meant, but they know what it
means. At least in the community they're communicating with.

No, there's a considerable difference between the standard template
library and the C++ standard library. If someone confuses both then that
person cannot claim that he knows what it means. Therefore, whenever that
person participates in a discussion and tries to communicate concepts
which are absurd then that person is bound to be in a discussion about
apples talking about oranges. More serious than that, that person may
even find himself trying to convince others that apples aren't apples, and
instead they are oranges.

There's no ignorance or mistake about it. No one is required to
know the full etymology of a word in order to be able to use it.

If someone ignores something then, by definition, he is ignorant regarding
that subject. If someone reiterates this "STL means STandard Library"
nonsense then not only is that person ignorant, he is trying to perpetuate
the fruit of their own ignorance. There is no doubt that this claim is
the result of ignorance.

All they have to know is how the person they're communicating
with will understand it.

If someone wants to talk about the STL then, at the very least, that
person should understand what the STL is. It's absurd to claim that,
during a conversation, the true and common definition of an expression,
and therefore it's meaning, should be thrown out and instead an ad-hoc and
transient definition should be used in it's place. Arguing this
constitutes trolling.

Which has changed over time.

No, it hasn't. And nor it will change just because you single-handedly
want to attribute to it a silly backronym.

When I first heard it, it meant a
library developed and maintained by Stepanov, including some
things that aren't in the standard C++ library today. You're
meaning doesn't correspond to the original use.

The meaning, in this context, is clear to anyone. It's the subset of
C++'s standard library which deals with template data structures and
associated components and that has it's origins in Stepanov's work.

It's not a mistake for people to use a common vocabulary, as
long as they understand one another.

The mistake you are trying to justify isn't "common vocabulary".
Moreover, if your true intention was to communicate with someone based on
"common vocabulary" then you would've had no problem acknowledging long
ago the error which is to refer to the STL as something other than the
Standard Template Library, and therefore you would've proceed to
communicate with that meaning in mind. Instead, you kept stubbornly
insisting on a patently wrong claim which is based on nothing more than
ignorance. Therefore, it's clear that you don't have any intention to
communicate with anyone using a common meaning. Instead, your intention
is to troll this thread.


Rui Maciel
 
P

ptyxs

To add an element to the discussion, Bjarne Stroustrup, in
Programming : Principle and Practise Using C++, I find this (section
20.2) :


"The C++ standard library provides a framework for dealing with data
as sequences of elements, called the STL. STL is usually said to be an
acronym for "standard template library". The STL is the part of the
ISO C++ standard library that provides containers (such as vector,
list and map) and generic algorithms (such as sort, find, and
accumulate). Thus we can - and do - refer to facilities such as
vector, as being part of both "the STL" and "the standard library".
Other standard library features, such as ostream, and C-style string
functions, are not part of the STL."
 
P

Paul

James Kanze said:
Who says so? Who even has the authority to say so? Language is
based on common usage; if everyone agrees that X means Y, then X
means Y. If not everyone agrees, then X is ambiguous. (Within
a given community, of course. When talking about C++,
"template" means something quite different than what a secretary
dealing with Word would understand.)

The issue is communicating, and redefining a term with your own
meaning doesn't improve communications. Thus, the meaning I
personally prefer for STL is the one Rui is arguing for, *but*
the meaning I personally prefer is really irrelevant; what
counts is how people use and understand the term in the
community I'm addressing. In the case of STL, that meaning is
ambiguous, so I avoid the term, speaking either of the standard
library, or Stepanov's original library.

--
Rui explained quite well why it's bollocks.

If there is an appropriate meaning for STL, Standard Template Library, and
we take something completely diffeferent such Stroustrups library or
Stanleys library or Standard library then this is not appropriate.

It's a purer acronym that uses only the initial letters of each word and
more fitting.
 
R

Rui Maciel

James said:
What's the point? If you want to cite something, it should at
least be an original source, which carries some weight.

If you criticize the messenger instead of the message then you are better
off not criticizing at all.


Rui Maciel
 
R

Rui Maciel

Paavo said:
So, are std::string and iostreams part of STL? Yes or no? The
std::string class design (particularly iterators) has been influenced by
Stepanov's work AFAIK. I'm not so sure about iostream iterators, but
they also sound similar.

The Standard Template Library encompasses the containers and iterators.


Rui Maciel
 
J

James Kanze

Only if you restrict the set of other people to those who use
and understand the acronym the same way you do. My experience
has been that C++ programmers use it with a variety of meanings,
so it doesn't have a precise meaning. You can try and pretend
it does, but all you achieve is poor communication.

[...]
You are trying to intellectualize and explain a failure to understand a
specific topic with appeals to the mutability of any languguage. It's
silly and disingenuous. No one can come here and claim that STL actually
means "super terrific library" or "strings, templates and lists" and then
proceed to try to defend that nonsense by claiming that, well, "you can't
stop the evolution of language".

Actually, anyone who wants can *claim* anything they like about
the language; see Humpty Dumpty. When a person uses a word, it
means exactly what they want it to mean. Communication depends
on consensus: if what I "want" the word to mean is the same as
what my listeners think it means, I communicate successfully.
If it doesn't, I don't.

The fact that we're having this discussion proves that there is
no consensus regarding STL. Which means that the term is
ambiguous. You can continue pretending that you (or someone
you're basing your opinion on) is the ultimate authority on the
meaning of the term, or you can effectively communicate with the
greater C++ community; but you can't do both.
If someone wastes bandwidth with claims that "STL means
STandard Library" then that person is both ignorant and
a troll.

Or more likely, they're just repeating something they've
learned.
 
J

James Kanze

If you criticize the messenger instead of the message then you
are better off not criticizing at all.

If you're appealing to authority, you're better off citing an
authority, rather than some second or third hand version---what
would be considered hearsay in a trial.

Note that this is not a criticism of Wikipedia per se. I like
Wikipedia a lot, and use it regularly. But it is not, and
doesn't claim to be, a primary source or an authority. See
http://en.wikipedia.org/wiki/Wikipedia:Researching_with_Wikipedia,
for example.
 
G

Gerhard Fiedler

Rui said:
The meaning, in this context, is clear to anyone. It's the subset of
C++'s standard library which deals with template data structures and
associated components and that has it's origins in Stepanov's work.

Not necessarily. This is a meaning that is compatible with Stroustrup's
usage. However, there seems to be a number of people who use "STL" to
refer to the full extent of the original Standard Template Library, not
only the part that went into the C++ ISO standard.

There are enough of them to warrant a Wikipedia entry. Since you seem to
accept Wikipedia as reference, here it is... :)

http://en.wikipedia.org/wiki/STL_(disambiguation)
http://en.wikipedia.org/wiki/Standard_Template_Library

This means that we have at least two widely accepted definitions -- and
ambiguity.

Gerhard
 
R

Rui Maciel

Gerhard said:
Not necessarily. This is a meaning that is compatible with Stroustrup's
usage. However, there seems to be a number of people who use "STL" to
refer to the full extent of the original Standard Template Library, not
only the part that went into the C++ ISO standard.

There are enough of them to warrant a Wikipedia entry. Since you seem to
accept Wikipedia as reference, here it is... :)

http://en.wikipedia.org/wiki/STL_(disambiguation)
http://en.wikipedia.org/wiki/Standard_Template_Library

This means that we have at least two widely accepted definitions -- and
ambiguity.

Understanding and acknowledging that the STL refers to C++'s standard
templated data structures is not "Stroustrup's usage". It's what it is.
It's only possible to state some other thing if a person failed to
understand what STL means and what it represents.

Regarding the links, the first link you provided only hosts links to
articles on topics which are refred to the STL acronym in some way. The
only link which relates to the C++ programming language is the article on
the Standard Template Library.

The second link you provided is an article which refers to the Standard
Template library. The first two sentences of that article read as
follows:

<quote>
The Standard Template Library (STL) is a software library partially
included in the C++ Standard Library. It provides containers, iterators,
algorithms, and functors.
</quote>

Therefore, there is no ambiguity. Two articles, only one definition, which
happens to coincide with the correct meaning.


Rui Maciel
 
R

Rui Maciel

Pete said:
Formally, Clauses 23, 24, and 25: Containers, Iterators, and
Algorithms. Most people forget about algorithms...

You are right. Silly me. Thanks for the correction.


Rui Maciel
 
J

James Kanze

On 2011-02-20 20:29:46 -0500, Rui Maciel said:
Formally, Clauses 23, 24, and 25: Containers, Iterators, and
Algorithms. Most people forget about algorithms...

What about <functional> and std::pair? They must have been part
of Stepanov's original library as well.
 
G

Gerhard Fiedler

Rui said:
Understanding and acknowledging that the STL refers to C++'s standard
templated data structures is not "Stroustrup's usage". It's what it
is. It's only possible to state some other thing if a person failed
to understand what STL means and what it represents.

I'm not really clear what you are saying here, but it sounds as if you
were saying that "STL" means "the templated structures in the C++
Standard Library that are based on the Standard Template Library
published by SGI" (like Stroustrup did, hence my calling this
"Stroustrup's usage").
The second link you provided is an article which refers to the
Standard Template library. The first two sentences of that article
read as follows:

<quote> The Standard Template Library (STL) is a software library
partially included in the C++ Standard Library. It provides
containers, iterators, algorithms, and functors. </quote>

Therefore, there is no ambiguity. Two articles, only one definition,
which happens to coincide with the correct meaning.

I didn't mean to imply that the two links represent two different
definitions. But they represent a definition that is different from the
one in your first paragraph: they state that "STL" means "the Standard
Template Library as published by SGI" (which incidentally is different
from the usage by Stroustrup, and could be called "Wikipedia's usage").

SGI's Standard Template Library is only partially included in the
templated structures in the C++ Standard Library, therefore the two
definitions are different.

You need to choose:

1- STL may mean "the templated structures in the C++ Standard Library".

2- STL may mean "the Standard Template Library published by SGI".

3- STL is ambiguous, as relevant numbers of people use it with different
meanings.

Gerhard
 

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

No members online now.

Forum statistics

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

Latest Threads

Top