How C++ should be taught

Pages: 12
Talk by Kate Gregory about how she teaches C++ to beginners.
Delivered at CppCon 2015.
Didn't watch the video as it seems quite lengthy. But I think nobody should teach you C++ other than you. Programming is a process of you teaching yourself. Even in college, students should not expect to just sit in the lecture theater with a "okay professor, teach me how to program applications!" mentality. Nobody taught me how to code, I taught myself how to do it and I'd like to think I'm a pretty good programmer, certainly not an expert but I learn from my mistakes every day. Moral of the story, your best C++ teacher is you.
It's worth remembering what Scott Meyers said about C++ being divided in 4 paradigms:

1. C Programming
2. Object Oriented C++
3. Template C++ including Template Meta Programming
4. The STL

As the video explains, start with 4.

The funniest part of the video, IMO:

Andre says "The fun begins with ..."
My take away from the video was to drop 1, combine 2 and 4, and bring in 3 much later along with pointers. The video seemed to stress that teaching them 1 up front creates poor C++ programmers.

Everyone has their idea of what makes a bad programmer depending on their area of expertise.

I got that video from this discussion thread on Allegro:
I've come to the conclusion that C++ is an awful language for teaching the basics of programming.

Trying to teach it effectively to complete beginners is an exercise in masochism, both for the teacher and (especially) for the beginner.
I would both agree and disagree with that. C++ was the first programming language I ever learned, and I very much appreciate that.

C++ can be a great beginning programming language if it is taught by a competent teacher, but that also sort of depends on what you want to get out of the learning experience. If all you want to learn is to make a simple program, then C++ may not be the best. If you want to become a successful programmer, then I think some experience in a lower-level language is good (or necessary? Every interview I've had presented me with questions about low-level language experience, and the interviewers seem consistently pleased with several years of C++ experience).
Uk Marine writes:
I think nobody should teach you C++ other than you.

I've always thought of programming (separate from Computer Science) as a skilled craft, sort of like cabinetry or playing a sport. Extending that metaphor, the teacher is more like a coach who shows you the right techniques while it's up to you to practice practice practice to master them.
closed account (GTbMSL3A)
I think C++ should be taught in a style dependent on the student. there's no one way because everyone's different.

I don't know what separates a good programmer from a bad programmer. maybe years of experience because a bad programmer would not be programming for long, eh?
I think C++ should be taught in a style dependent on the student

This is only possible if you have a private tutor. In a class with 20-30 students you can't do that.
closed account (GTbMSL3A)
yeah, but I'm just sayin'. know what i mean, bro?

I'm self-teaching myself C++, but advancing through books under the general guidance of past professors, so I guess my studies do depend on the class approach. I wish I could afford a private tutor.
Last edited on
Well Guys i can agree that C++ is no push over language, especially for the beginner but at the same time it teaches the learner to not only know how to program but to actually be a programmer and transitioning into other languages becomes relatively easy. The best way to learn C++ is to really study a lot of material and code examples and Bjarne has provided a lot of tools to enable one to learn C++ but it reuires a certain amount of discipline.
If you are a Computer student in college/university or wish to attend it
i recomend try C/Python instead of C++ as first choice in Programming Language.

althout choosing c++ not be a bad starting point but its better to start a little simpler
Language such as Python.

visit :
and see how python code are clear and easy to maintain

steps for begineers:
1. download latest version of python for your system:
(3.6.1), install it using the instruction.

2. run simple hello world! on IDLE (on Windows) or use python interpreter+Gedit on Linux

3. folow this tutorial:
Why would you recommend C over C++ as a beginners language?

Personally, I'm a fan of Scheme for beginners.
Learning Python or an other script language makes sense for beginners, since they are much easier to learn.
But why would you want to learn C ?
Learning C makes only sense when you plan a career as a maintenance programmer or maybe for embedded systems.

I guess the topic is not about whether some other language is good for beginners, the lecture is for people who have already decided they are to teach C++, so don't confuse the students by teaching them C at the same time.

Personally I think learning python as first step is easy for every one.
and i mentioned if he/she want to study Computer (no hobby) on university or college or wish to do
i recommend learn C as the Mother of all procedural, functional pograms.
and learning C instead of C++ as first step, because of C have less difficalt topics (i.e Class, polymorphism, etc.) .
Learning C help to find the internal of Computer World and if anyone want to study Good this fantastic
area must Learn it fine.

if he/she learn basic C (variables, I/O, Array,structs) switching to C++ by adding Class topics and some
simple things (cin/cout instead of printf/scanf) is very easy.

Learning C help to make a way to C++/Java/C#.
Teaching C before C++ has been the traditional way of teaching C++. This has not been a good idea for a very long time, because you end up teaching a lot of C stuff that gets replaced in modern C++, such as:

* malloc/free for dynamic memory instead of smart pointers/containers.
* Using pointers for pass by reference instead of references.
* C-style arrays instead of std::array.
* Any error-handling scheme instead of C++ exceptions.
* Traditional for-loops for iteration instead of C++ iterators or range-based for loops.
* Plain structs instead of classes.
* Re-implementing a variety of data structures when their equivalents exist in the standard library.
* Using function pointers instead of std::function.
* Using preprocessor macros for compile-time constants instead of constexpr.

Furthermore, it's easy to give inexperienced programmers the delusion that just because they know C++, they can code in C easily by just sticking to some careful subset of C++, when they lack the discipline for doing a lot of things in C that were otherwise taken care of automatically in C++ (see: dynamic memory management without using compiler extensions).

Finally, C is not the mother of procedural programming. That title belongs to the ALGOL languages (or arguably Fortran). It's also not the mother of functional programming, because that title undeniably belongs to Lisp.

Last edited on
Has anyone ever actually referred to C as "the mother of functional programming"?
i recommend learn C as the Mother of all procedural, functional pograms

It appears so
I suspect the poster is just confused about the meaning of "functional".
Pages: 12