Yes, it certainly would be a great gain for every C++ programmer to fully understand the way STL is implemented and works. Looking into the implementation of STL can teach you many things, but is a complicated task. I took a few hours to roam thru the source code of STLPort and the main achievement of that was realizing the fact that I'd need to spend much more time in order to get a grip on the implementation.Quote:
Originally posted by AnthonyMai
<snip>
I encourage people to look into the source code of STL and judge by themselves whether they want to use piece of code like that, or they are allowed to write code in that kind of style, after they have seen the STL source code for themselves. Lack of knowledge of STL internals is the most frequent cause of mis-use of STL by programmers.
If reading and understanding the STL source code would be a demand prior beginning to use STL, many programmers, especially the beginners, would never come to actually use STL, being frightened away by the complexity of its implementation.
Also, we should think about the concept of separating the interface of a class (library) from its implementation. I'm not referring to the code organization here, but to the concept itself. I think you can use STL at a decent level by understanding only its interface and documentation (widely speaking: books, examples, articles). I think that the lack of understanding the interface and the concepts of STL is "the most frequent cause of mis-use of STL by programmers".
