Monday, July 09, 2012

What's wrong with The New Boston's C++ tutorial.

(I originally posted this on Reddit, but decided I'd like to keep it around for the next time someone asked.)


He does not have context. Error no. 1 of all C++ tutorials online, and one that kills learning immediately. Someone who is starting to learn C++ should not have the syntax presented to them without explaining the purpose of the syntax; a lot of newbies don't understand this, and therefore consider that the tutorial is good because it is "simple".

Cases where he does this:

  • Functions are introduced this way. Notice that in videos 9-11, he does not show a single function that is actually useful. Having watched that, a newbie will not have a feeling for whether a function is appropriate or not.
  • Videos 12-15 are similar, and are also horribly out of place. He introduces a bunch of syntax, doesn't use it for anything meaningful, then forgets about them for roughly 25 videos. Someone coming from Java may think "Oh, right, classes", and then (wrongly!) use them for everything. Someone with no programming background will once again go "Why would I want this?", and be entirely right.
  • All this remains true for the introduction of if, for, while, and switch. There are a few examples, but they do not adequately cover the introduced material.
  • Unary scope resolution operator? Seriously? Apart from the unary version being used extremely rarely, the sane advice to give is "don't shadow if you don't know what you're doing". Beginners do not need another bit of syntax shoved down their throats.
  • Arrays. Oh hey, again useless toy examples. I'm noticing a pattern. Oh, and he fails to explain what happens when you pass an array to a function.
  • Pointers, again, done horribly wrong. No use-cases, no demonstration of why indirection would be beneficial. Also, done far too early: he hasn't even covered std::vector yet.
  • One last example, and probably the most egregious in the whole tutorial: he introduces inheritance, and then shows a daughter inheriting from a mother. No, I did not swap the two around. I'm not sure how he wrote it without realising that "every daughter is a mother" makes no sense.

I'll leave the rest of such cases for you to find, there's plenty more in there. There are some factual errors as well (see arrays), but I don't have the time to track those down right now. Comment away if you know of any.

So, once you've watched all his videos and have been taught a bunch of syntax, where do you stand? Turns out the C++ world has a reasonably large group of "misguided newbies" that, just like you, learned C++ from some 'tut' and now can write code that compiles as C++, but don't understand the core principles of the language. The code is bad (usually in the sense of buggy and hard to maintain), and is unpleasant to work with even for the original author. Most common omissions are:

  • RAII. You know, that thing that makes C++ manageable. If you don't know about it, you are not good at C++. If a tutorial does not introduce it, it does not cover C++ well.
  • In a similar vein, the rule of three.
  • const-correctness.
  • Exceptions, and more importantly, exception safety.
  • What the standard library offers.
  • That's not to mention things that are useful but not essential to use, such as templates, operator overloading (except operator=), lambdas, functors, and iterators.

So, no "Bucky isn't a bad C++ teacher" is simply not true. He is in any case a bad teacher, and the omissions he makes lead me to suspect he's not any good at C++, either. If he'd take down his videos, the internet would be a better place.

6 comments:

  1. very informative post indeed .being enrolled in http://www.wiziq.com/course/5776-object-oriented-programming-with-c
    i was looking for such articles online to assist me and your article helped me a lot. i really like that you are providing such information.

    ReplyDelete
  2. It's nice to hear someone else say this. All his comments say things about how "He Knows Everything" and "You're a god, Bucky!!!" but he doesn't know crud. I'm a Junior at UCI's Computer Science department, so I know...

    ReplyDelete
  3. I'm disheartened to read this...

    I'm currently taking Intro to C++ Programming in college and found that watching his videos while reading my textbook has helped me quite a bit.

    I really like his pace, and the way he teaches. If only he taught the proper content...

    Is there any other resource that offers videos such as his that are actually good to learn from? I just find it so much easier to grasp a concept when someone is speaking and showing how its done rather than reading it on my own on a static book.

    ReplyDelete
    Replies
    1. Udacity offers good videos on computer sciences, but they aren't specifically C++. C++ videos tend to be rather disappointing at that level. You could try ReelLearning (http://www.youtube.com/user/ReelLearning); I'm still undecided on that one.

      My main piece of advice would be to try to write it yourself. See how the pieces fit together, ask for code reviews, and try to understand why certain things do and don't work. Learning the language by trial and error is unrealistic, but figuring some things out yourself is also highly helpful.

      Delete
    2. Makes me wonder will you repeat that if you become professional programmer. I'm Java programmer and trust me... his Java tutorial's have a lot of inaccuracies. Recently we laughed in Stackoverflow's chat (room Python) at one of his tutorials. Python tutorial 34, if I remember well.

      Delete
  4. thanks a lot bro, and i saw those c++ video on your github i may aswell have a look at them :D

    ReplyDelete