What to do after Python?

Kenneth Loafman ken at lt.com
Sun Feb 18 18:28:00 EST 2001


Sheila King wrote:
> 
> I teach C++ as a first programming language to high school students, via the
> AP Computer Science Curriculum. (The course I teach is supposed to be
> equivalent to a first semester University course for CS majors.) I think that
> the trick, is to use a carefully selected subset of the C++ language.
> 
> Still, I must say that I really enjoy the Python I've been teaching myself the
> last few months. I do intend to do a number of projects in Python, eventually.

Please also teach the C Standard Library along with C++.  I've seen some
very poor examples of "reinventing the wheel" happen because the student
did not even know the basics of the C Standard Library and its
interaction with the basic elements of C/C++.  Consider one case I found
where the goal was to remove the last character of a line.  Instead of
using something like:

   if (strlen(s)) s[strlen(s)-1] = 0

the (7-year C++ veteran) wrote several lines of code that:

   reversed the string
   trimmed the first char
   re-reversed the string

Considering that he was using M$ C++ CString operations, the code took
several thousand instructions, instead of a just a few.

...Thanks,
...Kenneth




More information about the Python-list mailing list