The Standard Template Library is one of a select group of programming libraries for the C++ programming language, and one of its goals is to make the task of software development easier, less bug-prone, portable, efficient, and compatible with other standard libraries. Get motivated for the learning journey you have just started.
- [Instructor] Let's explore why we need the C++ Standard Template Library. There are many good reasons to use this library, and there's also some inevitable criticism. So let me tell you the most important reasons why I think you should integrate the STL in your programming knowledge. The STL enables us to create code quickly, efficiently, coherently, and generically. Let me tell you what I mean.
You'll create code quickly because the STL is, well, a library, so chances are the data structure and algorithm you want to perform are at least basically already implemented and available to you. You'll create efficient code simply because this library has been out there since the 1980s, implemented for a handful of compiler toolchains, and it has been constantly maintained by its implementation developers so that it produces the most efficient output possible.
You'll create code that is coherent with the code written by other programmers in your team. It is often understood that a C++ programmer knows not just the programming language, but also most of the many libraries that are included in its implementations. In fact, the Standard Template Library is so frequently available in C++ compiler toolchains and IDs, that it's common to refer to the STL and the C++ standard library interchangeably.
This is sometimes a touchy topic, so be advised that the STL and the C++ standard library are formally two different things. Now here's what I think is the most important reason to use the C++ STL. You'll create generic code. By generic, I mean that you're required to specify your data types at instantiation, because libraries are written as templates. This flexibility allows the programmer to concentrate on the data structure's behavior, regardless of its content.
We'll cover more about this in the course.
- Why the STL is important
- Containers and iterators
- Vectors and lists
- Stacks and dequeues
- Associative containers