I am now teaching an OOP course to 2nd year undergrads. This is actually a course in advanced programming in Java. In the next semester, I am going to teach the same students, a C++ course. From what I know, C++ and Java are quite similar - there are differences, but they can be covered in 2-3 hours, which are one week of teaching. This leaves me 12 more weeks, and I wonder what else to teach.
I looked at the syllabus from previous year and it looks quite similar to my current Java course: OOP, overloading, generics, unit-testing, software design, etc. I don't want to teach the same course twice in different languages...
One idea that I had is to focus, not on teaching the language itself but on teaching specific practical applications in which C++ has a clear competitive advantage. For example, if game-programming is usually done in C++, then I can focus on game-programming. So my first question is: what kind of applications are written in C++ substantially more than in Java?
And my second question: what other new topics can I include in this C++ course?
[NOTE: in case this is relevant, the same students currently take a course in C].
C++
, has multiple inheritance. Few modern languages have this, even fewer do it properly (Eiffel being an exception). Take some inheritance structure, that can also be comparable. Implement it, so that you implement each of<
,>
,<=
,>=
,=
,!=
. You can implement them all in terms or<
in the base class, then the inherited class only has to implement<
. Nocompare(a:T, b:T): int{-1,0,1}
. Note multiple inheritance is safe, but repeated inheritance is not, and must be handled correctly. $\endgroup$