Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to teach a crash course on C++? [closed]

Tags:

c++

In a few weeks we'll be teaching a crash course on C++ for Java programmers straight out of college. They have little or no experience yet with C or C++.

Previous editions of this course were just 1 or 2 half-day sessions and covered topics including:

  • new language features, e.g.
    • header vs. implementation
    • pointers and references
    • memory management
    • operator overloading
    • templates
  • the standard libraries, e.g.
    • the C library headers
    • basic iostreams
    • basic STL
  • using libraries (headers, linking)
  • they'll be using Linux, so
    • basic Linux console commands
    • gcc and how to interpret its error messages
    • Makefiles and autotools
  • basic debugger commands
  • any topic they ask about

During the course each person individually writes, compiles, runs, and debugs simple programs using the newly introduced features. Is this the best way to learn?

Which topics do you consider most crucial?
Which topics should be added or removed?
Which topics just can't be covered adequately in a short time?

like image 877
palm3D Avatar asked Sep 07 '08 15:09

palm3D


1 Answers

I can only once again point to Stroustrup and preach: Don't teach the C subset! It's important, but not for beginners! C++ is complex enough as it is and the standard library classes, especially the STL, is much more important and (at least superficially) easier to understand than the C subset of C++.

Same goes for pointers and heap memory allocation, incidentally. Of course they're important but only after having taught the STL containers.

Another important concept that new students have to get their head around is the concept of different compilation units, the One Definition Rule (because if you don't know it you won't be able to decypher error messages) and headers. This is actually quite a barrier and one that has to be breached early on.

Apart from the language features the most important thing to be taught is how to understand the C++ compiler and how to get help. Getting help (i.e. knowing how to search for the right information) in my experience is the single most important thing that has to be taught about C++.

I've had quite good experiences with this order of teaching in the past.

/EDIT: If you happen to know any German, take a look at http://madrat.net/coding/cpp/skript, part of a very short introduction used in one of my courses.

like image 103
Konrad Rudolph Avatar answered Oct 01 '22 17:10

Konrad Rudolph