Teaching Python

Ryan Paul segphault at sbcglobal.net
Sat Jun 12 21:51:38 CEST 2004

On Sat, 12 Jun 2004 14:45:21 +0000, Mediocre Person wrote:

> Well, there's OOP and then there's OOP, right? The first year students 
> have learned to _use_ pre-defined objects, but not design and create 
> classes.

That makes sense. If they haven't learned to create objects yet, then
python is probably the most practical way to teach it.

>  Can you give me some references to this, such as samples of student
>  work? I would like to see what grade 6 students can do in two months!

This was part of a special program at my former junior high school. They
offered a single semester computer programming class as an 'elective'.
Thematically, the class focused on using object oriented idioms to solve
problems. Most of the assignments were designed to emphasize the power and
flexibility of OO.

I think that the immediate and consistent focus on OO was part of what
made them capable of doing so much, so quickly. Towards the end of the
semester, they were working in groups, writing games. Their devotion to
their work was somewhat inspiring. Many of them put in many extra hours to
improve their work, and they developed a sort of competitive enthusiasm,
challenging each other with small problems and comparing their solutions.

The instructor of that programming class is doing a summer program with
some of the students that will involve putting together a web site about
the programming class that will showcase some of the student programs. He
wants to teach them how to use mod_python. As soon as he gives me the
address, i'll be sure to post it on a.l.p, as i'm sure there are many here
who would be interested.

> I agree that the syntax of Python makes it is easy to learn. However, I
> think I've got a pretty good imagination where material is concerned!
> There are excellent tie-ins to their mathematics, physics, chemistry,
> and biology curricula. For instance, I recently came across the concept
> of partitions in number theory, and computing all the partitions of an
> integer is a dilly of a pickle of a problem!

This is obviously why I'm not a teacher and you are. =} Sounds like you
have some creative ways to tie it into general curriculum.

> And, of course, it's really not about the language, in the end, after
> all, but what you can learn to do with it. In which case, you say,
> "AHA--so what was wrong with c++???" In a word, nothing. And I'll *miss*
> all the lovely memory management lessons we did to develop our own
> vector and list classes.

I'd never ask "what is wrong with c++", because I'm already painfully
aware of the answer: almost everything. I completely understand the
motivation for moving away from it. When I write c++ I spend more time
thinking about how to deal with the language's severe flaws, rather than
how to get the job done.

>I know nothing about ocaml or haskell, but I'll be sure to research them
> this summer, so thanks for the tip!

Really, it depends on what your goals are, and what you believe the
capacity of the students to be. If you are introducing object oriented
programming, python is a good choice, especially if the students have
never been exposed to anything like python before.

I know that if, in my senior year of high school, I had seen a python
class offered, I would probably have laughed at the prospect, and taken
something more challenging.

OCaml is also free, and it also provides an interactive top-level. It has
automatic memory management, and type inference. It is statically typed,
and that makes it significantly more challenging to use effectively. OCaml
has some interesting features, and learning to use them well requires a
lot of thought, and careful attention to detail. Some aspects altered the
way I think about programming logic (particularly: pattern matching,
recursive types, stateless OO, and parametric polymorphism.)

Based on what you have said, it sounds like python may be the best choice
for your students at this point. I live in california, and the schools in
my immediate vicinity all have very strong (well funded) tech programs.
There are computers in most of the classrooms, and a simple computer
science class is required for all students at the junior high, so the
level of the students here is probably not indicative of students
everywhere, and I hadnt really stopped to think about that before I made
my post last night.

As far as teaching python is concerned, the Edu-Sig is probably the best
place for you to start. 


You find this specific link insightful, it talks about python at a high
school level:

Best of luck!


More information about the Python-list mailing list