There's a good reason why people go from C++ to Python and do not go from Python to C++. I'm not sure I see the point in confusing them with all the quirks and weirdness of C++, and I think the reason why you can't find much material is because others agree. Python is good, C++ is something we only do when a client forces us to.
Background
For a while I taught C to COBOL programmers. Many complain about C-isms. And correctly, BTW. From a COBOL starting point, C is very hard to learn because it lacks COBOL features. They didn't like it.
Also, I used to teach SQL. Everyone compares SQL with flat-files or other non-SQL database access. In the olden days, COBOL folks would have used DL/1 with a database called IMS. By comparison the relational model and SQL were awful. Truly horrible. Note that IMS is barely used anywhere and SQL is still popular. That's not the point.
Learning a new language (C, SQL, C++) is not an informed decision -- you don't know the new language -- your opinion is uninformed. You must fall back on a subjective value judgement: the old language/technology is more familiar and therefore "better". That's human nature, and you're going to have to find a way to work past people's urge to cling to what they know when confronted with the unknown.
Compounding the natural tendency to complain about the new/unknown, you have the further problem that C++ really is bad. You have two hurdles to jump. Comparing with Python assures that you will trip over one or both.
Edit
(First, update your question with additional information...)
On C++...
You should probably begin with C++ as a whole new language, not as an "evolution" from Python. The transferrable skills (abstraction, sequential reasoning, etc.) are independent of all languages.
You should, further, teach C++ as if Python didn't exist, and allow your students to draw their own conclusions about C++'s similarities and differences from Python.
I would not, for example, try to compare SQL and Python; nor would I try and compare HTML and Python. In a similar way, I would stay away from any parallels between C++ and Python.
The issue is that C++ has so many foreign constructs that there's no bridging from Python.
Starting on day 1, C++ has the cout <<
construct which is NOT an analog of print
. It's an operation between disparate types, and has some support for primitive types. There's nothing like this in Python and it's the first thing you'll cover.
Then, C++ has "primitive" types which are not objects and do not have methods. This is the second thing you'll cover and covering it in the negative (what these "objects" lack) is probably just confusing. Better to ignore Python and cover primitive types like they're an ordinary thing, not an accident waiting to happen.
Variable declarations are -- of course -- a show-stopper. I'd ask "why can't C++ reason this out?" What's your answer? "It doesn't, get over it." Every will want a generic object &
declaration, but that's crazy. At this point, you have to separate an object from it's type, since the C++ type is carried in the variable declaration and the object is just a puddle of bits. Again, the "negative" sense of "C++ separates these things" probably won't be helpful. You'll need to focus on some positive reasons -- and avoid comparison with Python.
C++ has references and pointers. If there's any way to avoid teaching them about pointers, your life will probably be better. References are closer to what they're used to than pointers.
Input (via << cin
for example) is nothing like Python because a variable gets updated; an object isn't created (necessarily).
Statement syntax is easy. They already know how to format an indent. A few extra {}
's won't be a terribly big problem. I used to teach C to COBOL programmers, and they couldn't get the {}
's right, either.
Function definitions will probably be easy. The mandatory return business in C++ (there's no default return None
behavior) should (again) not be a negative, but a positive. It's more explicit or some such justification.
Objects will be a chore. Find a collection library you can live with (like STL or something) and teach that in depth. Python has glorious collections, C++ has nothing. Avoid teaching about primitive arrays if you can -- they're an accident waiting to happen.
This collection library should be (a) complete and (b) emphasize references over pointers. It would probably be helpful to use a library which derives from object
, since that's somewhat more Pythonic. However, this may only raise the frustration level.
Class definitions come last, and will be a Herculean task. The endless overheads of separate class declarations in .hpp
files, plus the confusing issue of when to use a reference and when not to use a reference will be a pretty big deal. I think that "always use a reference for objects" and "never use a reference for primitive types" is probably the simplest (and cleanest) way to come to grips with C++.
Bottom line. Cover C++ in isolation. Let them draw their own conclusions. The differences are too huge to construct a bridge from Python to C++.