Out of the loop

for (int i = 0; i < ARRAY_SIZE; i++)
{ 
  // do something to an array...

You should be ashamed of yourself. That code is a crime against modern C++. Come out with something like that down the ACCU, you could find yourself sentenced to six months mentoring Linus Torvalds through his Visual Basic breakdown.

Out of the (C++) loop - The Register

That article is one of the best descriptions of troubles with the STL I've read. When I use the STL, things seems far more complicated then they should be, the code becomes more verbose and I feel like the actual meaning and intents are obscured, which is ironic because it's suppose to have the opposite effect.

Look at how much typing you have to do just to declare an simple iterator:

std::map<std::string, FoobarClass>::const_iterator itor;

And how exactly is this supposed to be better?

But when I don't use the STL, I feel like I'm doing something wrong somehow because I'm not enjoying benefits of meta programming and templates. Clearly there is something wrong with me.

The way I've heard it, using the STL is supposed to save you all sorts of time while making your code rock solid, whitening your teeth and improving how your odor is perceived by the opposite sex. But all I get is a smug satisfaction that I was at least smart enough to get it to compile and run, and that only lasts about ten minutes. Then the next time I see the code I'm horrified how ugly it looks and I curse myself for picking the STL in the first place.

If only I were somehow smart enough to enjoy all it's great benefits, but apparently I am too dim to find it productive beyond simple containers.

Posted September 25, 2006 2:09 PM