tags:

views:

334

answers:

6

This may seem a trivial question, but it's one that's bothered me a lot lately. Why do some programmers refer to "C++/STL" like it's a different language? The STL is part of the C++ standard library -- and therefore is part of the language, "C++". It's not a separate component, and it does not live alone in the scope of things C++. Yet some continually act like it's a different language altogether. Why?

+5  A: 

Probably because STL came a little late to the C++ game, and many people have written code that does not use any STL. For example, think early win32 programming with MFC.

Justin Ethier
+4  A: 

Guess:

When C++ was first released, the STL did not exist. It came into existence later as an optional addition and then was incorporated into the standard.

Heath Hunnicutt
@SDGator: You are incorrect. The first "standard C++", C++98, includes the STL as part of the standard library.
Billy ONeal
Sure, but C++ was around for 10 years before it was standardized.
Gabe
@Gabe and dreamlax: I was not referring to Heath's answer, I was referring to a comment (now deleted) by SDGator. Heath is completely correct.
Billy ONeal
@BIllyONeal: deleted my comment because I just saw that you were addressing someone else :)
dreamlax
It wasn't really a guess, since my explanation is the reason that I personally consider STL an add-on to C++. It didn't exist when I learned C++.
Heath Hunnicutt
+7  A: 

An understanding of the STL isn't necessary to understand C++. It's useful to have when you need ADTs, but you can go (could have gone?) through your whole C++ career without needing it.

Ignacio Vazquez-Abrams
+1, there are equivalent/different/(better?) libraries.
Bertrand Marron
+1 -- but then why is there no C++/Iostreams? You might not actually be needing to understand iostreams but nobody treats them as another language...
Billy ONeal
That I don't know. Probably due to size. iostreams are a trick of operator overloading, but the STL is a big, sticky ball of about two dozen or so headers.
Ignacio Vazquez-Abrams
Accepting this answer -- but it's not actually a "correct" one since this question is sort-of subjective. I'm accepting it because it has the greatest number of votes.
Billy ONeal
Also some application spaces are allergic to the STL in ways that they're not to other features like OOP and namespaces.
Crashworks
@Billy: it may be because IOStreams doesn't represent a new, separate paradigm. It is just a not-very-good OOP'ified stream library. STL is both widely different from the code most people are used to, and has a broad enough scope to be useful in its own right. You can't do much with just streams, but with containers, iterators and algorithms, you can write some fairly sophisticated programs.
jalf
+5  A: 

The above answers are really good; I'm only going to add to their content in a broader context.

Developers might refer to language/api|library e.g. C/Win32, Java/Struts, Java/Spring, C#/.net MVC because there are in essence two knowledge bases - knowledge of the language in question and knowledge of how to use that specific library, API or framework. Something like Win32 is pretty huge, as is say Django, which I'm currently learning. Django itself works in a very specific way and knowing that is what I'm learning, not Python.

The same is true of C++/MFC or C++/Boost or C++/STL. The language is C++ - the API/library you're using is MFC, Boost or STL.

Ninefingers
If it's a library, than fine, but the STL is a core part of the language itself, and by saying C++ you're implying STL. It's not a third party library. I don't see Java/Standard Collections, or C#/Generics anywhere....
Billy ONeal
@BillyONeal: STL is not part of the C++ standard, and it is not a core part of the language.
dreamlax
@dreamlax: Yes, it is. The first "standard C++", C++98, includes the STL as part of the standard library. C++03 is the current standard, which is just C++98 with a few corrections.
Billy ONeal
@BillyONeal: See http://stackoverflow.com/questions/2245196/c-urban-myths for more details.
dreamlax
@dreamlax: The word "Standard Template Library" does not exist in the standard because the "STL" is just part of the standard library. `vector`, `string`, the standard algorithms and such ARE in the standard library.
Billy ONeal
The quibble in that link is just that the STL is something that SGI invented, most of which was incorporated, with some changes, into the standard. STL has become a misnomer for that part of the standard. Nobody when they say "C++/STL" means "standard C++, together with SGI's STL". If nothing else, such a beast cannot exist, since some definitions conflict between the two.
Steve Jessop
@BillyONeal: The Standard Template Library (published by SGI) and the C++ Standard Library may share common functionality but that does not mean the terms are interchangeable or that one is a superset of the other. The STL for example contains a class called `slist` which is not in the C++ Standard Library.
dreamlax
@dreamlax: Okay, that might be a minor technicality, but when 99.9% of C++ programmers refer to "the STL", they are not referring to SGI's library, rather, they are referring to the standard containers, iterators, and algorithms, which were taken from the original STL. That core piece of language is what I am referring to in my question.
Billy ONeal
@dreamlax: if Ninefingers is right, and "C++/STL" means "language+library", and you are right to use the proper definition of STL, then the term itself is wrong, since it is not possible to have standard C++ together with the "real" STL. Since some people do say "C++/STL", we therefore cannot assume they mean the proper definition of STL. The question at hand is, what do they mean?
Steve Jessop
+7  A: 

It's possible to be a competent and experienced C++ programmer and never use the STL. You may be using Boost or ACE, or been an MFC windows programmer for 10 years.

If you want someone experienced in using the STL, asking for someone who knows C++ is no guarantee that you'll get one.

Also for my mind, writing code that's heavily dependent on the STL feels very different to writing, say, MFC code. They might as well be different languages. They certainly won't look particularly similar.

Spike
A: 

When writing a resume, people would often list C/C++ as a language, which, in many cases means they don't know either.

Sometime resumes would list "Visual C++" as a language, trying to indicate they don't know what a language is.

This, together with "great knowledge of C++ and PHP" statements, go strait into recycle bin at my firm. Not because they are necessarily bad programmers - but because the interview time waste is not worth it.

Pavel Radzivilovsky
What's wrong with people who know both C++ and PHP?
Frank
What is wrong is mentioning two technologies of vastly different complexities in One Sentence.
Pavel Radzivilovsky