Reflection on Teaching C++ to Novice Students

posted by Karsten

I have just finished 5 weeks of teaching C++ to the first year students at University of Reading. My impression is that my personal effort went well, for instance the students actually clapped when I finished my last lecture today – something that came as a complete surprise to me! Although a very nice surprise…

Having said that I believe that C/C++ isn’t the right language choice to teach programming to novice programmers. In a session a few weeks ago, where I gave feedback to them in the form of an interactive “Post-it coloured stickers show me what you think” session, it was brought to my attention that more “basic” programming construct such as pointers and arrays were still a struggle. I actually had to create a fast re-cap session on pointers to somehow hammer this concept into them. The questions I started to get were much more satisfying after this session. The problem is that what is the chance of learning function overloading, method de-referencing or multiple inheritance, if you don’t get how the arrays and pointers interact in the examples you see, as a struggling student, within the lecture notes? You probably go blind by these concepts before you even start thinking about inheritance at all!

Don’t get me wrong. Object Orientation is a crucial concept for aspiring Computer Scientists and programmers to understand, but the combination of C and then OOP in the form of C++ does not help teaching this. I believe that taking a OOP language such as Python, Java, C# or even VB would enable a much cleaner learning path into OOP whilst showing the concepts of programming. Once you understand these within the framework of OOP, you don’t really need to be taught imperative programming, because you would understand it quite easily!

Unfortunately I am not the person deciding this. I have voiced my opinion appropriately many times. I have had an interesting time teaching C++, wouldn’t mind doing it again, as most students clearly have moved far on the learning curve of programming – I just think it could be done more effectively…


2 Responses to “Reflection on Teaching C++ to Novice Students”

  1. Robert Cathles says:

    I did exactly the same module in first year but it was taught by different lecturers. However they did have the same problem as well with pointers. The conclusion from the C++ course was that everyone wanted to avoid pointers because they either didn’t make sense, or they seemed useless. At the end of first year Computer Scientists are taught Python (and make a computer game), and in 2nd year they teach Java (group project and individual project involving IMDb). With Java you can kind of cover C# as they are similar languages. Students studying IT learn Visual Basic instead in their 2nd year to make a card game.

    I think with pointers it just needs to be dumbed down with as many examples as possible or with videos such as this:

    OOP is taught a little in first year with C++ but there is (still?) a module on OOP for 2nd year Computer Science (OOD), which fits nicely with the Java module too. Everyone I’ve spoken to has agreed that they would rather code in a different language to C++ because of the pointer problems/confusion/misunderstanding in first year. But I think it is more down to the concept itself.

  2. Karsten says:

    Funny – I actually decided to show that video in a following lecture, just to make it as “dumbed” down as possible. I also created a lecture re-introducing pointers with two different examples of their use. The questions I got were much better afterwards. For instance asking specific problems rather than just saying “I don’t get them”.

    Hopefully an improvement will be evident in the final coursework and potential exam questions – crossing fingers…

Place your comment

Please fill your data and comment below.
Your comment