Tuesday, July 10, 2012

What's wrong with RTFM's C++ tutorial?

There has been too much ink spilt on this already, as even the author admits, so I don't feel particularly eager to point it all out again.  However, to preserve yet another reddit reply of mine:


  • The tutorial has some technical mistakes. For example, describing sizeof as a function is very wrong. (He also abuses "keyword" for just about everything.)
  • There is no context. This is my single biggest gripes with basically all tutorials: they fail to explain features in the context that they are used in. Functions are not just places you put code in so that it isn't all in one place: they are abstractions. Same with classes.
  • Further about absence of context: pointers are (as is painfully common) not explained with proper context. The way the tutorial shows them does not represent how they're actually used, and makes them look useless.
  • Important concepts for practical coding (such as const correctness and RAII) are not mentioned enough. Oh, let's not forget exception safety. When he does mention using const as much as possible, he for some reason decides to announce it as an object oriented programming thing (and goes on an utter tangent).
  • As far as I can tell, he doesn't introduce using standard containers.

So, to summarize: he says things that are false, he fails to say things that are true, and he says things in the wrong order.  Just say no.

No comments:

Post a Comment