Effective STL – Scott Meyers

I finally got through Scott Meyers’ Effective STL book. After reading that book, I came to the realization just how problematic C/C++ is and how crappy the STL really is. His book teaches you a lot about the STL, but it also teaches you just how many “special cases” there are when using the STL. It seems like a good majority of the book is simply avoiding the STL’s pitfalls and special cases that screw something up. Since the STL is written in C++, i came to the conclusion that C++ is crappy, just like the STL.  Yes, it is powerful, but there are inconsistencies, and other issues I hate. A couple of them are 1) Multiple inclusion of header files. 2) Stuff not compiling because you included things in the wrong order. 3) Using “.” or “->” depending on whether it’s a pointer or not.

I’ve noticed after reading that book that all of these issues are nonexistent in C#. It really the .NET framework to be used in conjunction. At least I only know of one C# compiler and that’s Microsoft’s. On the other hand, I really like C++’s ability to manipulate bits which is really helpful.

Overall, the book is pretty good. I wish there were a condensed version of his book though that just had the “what” with the brief explanations without all the “why.” Most of his book consists of the “why.” You could just read the table of contents, but you might not understand it completely based on the chapter titles.

The conclusion I came to is: the STL is crappy because it needs a book (ie, this one) to tell you what to avoid, and where it’s pitfalls are as well as how to use it. It should be easy to use, like any API, but the STL is well tested, and works pretty well as long as you don’t get too fancy with it. If you get fancy with it, either 1) be prepared for some headaches, or 2) know everything about the components you’re working with and their downfalls.

Leave a Reply

You must be logged in to post a comment.