This is wrong, wrong, wrong, wrong! You should definitely at least link them to this thread. They need to know why that is wrong."The main problem with the STL is that it was clearly written by a committee"
Why is that clear? Which committee wrote it? What suffered as a result? As an interesting thing to note, my copy of the <vector> header has the copyright notice "Copyright (c) 1992-2008 by P.J. Plauger". Written by a committee or written by one guy? "It is clunky"
Why? What does 'clunky' mean? Does it mean slow? The source code is available, meaning the compiler can make optimisation and inlining decisions that are impossible when using .lib libraries. This actually makes it extremely fast. I once tried to write my own container faster than vector. I thought it'd be easy, and took lots of dangerous shortcuts to make it faster. It was slower. Does clunky mean badly designed? The STL is one of the best designed libraries out there, probably ahead of its time too."Method names are often verbose"
Which method names? find
? Verbose? Is this a joke?
If you don't like the std:: prefix, stick using std::find
at the top and you can use find
like a global function."Use of methods is rarely intuitive"
Which methods? Is my_vector.pop_back() to remove the last element really something hard to get your head round?No bounds checking is done on arrays(vectors)
Incorrect. vector::operator does not bounds check, which is a deliberate decision. vector::at() bounds checks, and throws out_of_range exceptions if you pass an invalid index. Also, iterators are bounds checked in debug mode, so i++
will throw an exception if you're already at the end of an array. If it was a pointer, I'd be running in to undefined memory and left pretty clueless about what the problem is. This has saved my ass many a time.The names of methods and classes is often non-mainstream
You mean, everyone in the world agreeing that a vector is called a vector isn't mainstream? Again, I point to find
as well.Iterators are used instead of pointers
A strong benefit instead of a problem. As mentioned, they are bounds checked when debugging, so you can never have an iterator to random memory (how many pointers have you had pointing to nowhere?). They are equally as fast as using pointers. The syntax is also identical for any container. Whether you're using a binary tree, a linked list or a contiguous array, i++ means move to the next element, wherever it is. This simplifies the readability of code greatly, and also means if I suddenly decide I want to use a vector instead of a linked list for my container, I just need to change a few typedefs. I wouldn't even need to change any code! Better yet, the syntax is pretty much identical to that of pointers. I don't get why this is listed as a problem.Does not always interface well with C++
Like where? The containers support any
C++ object with the proper copy constructors and such, and they even work combined with normal C arrays.
In short, this is obviously not researched at all, just a list of completely fabricated "problems", and is amazingly inaccurate. Every C++ programmer should learn and use the STL.