Teaching python (programming) to children

Andrew Dalke dalke at dalkescientific.com
Tue Nov 13 04:10:41 CET 2001

David Andreas Alderud:
>Depends on the audience I guess, people who are interested in
>programming tend to be interested in how the computer works and
>how to write efficient programs.

When I started programming I didn't know how the hardware worked.
Nearly 20 years later, I still don't know.  Frankly, I know just
enough to say things like "dopants", "Fermi surface" and "binary
logic gate" then handwave up to the C view of the system.

I tried learning the peek/pokes people used for performance and
gave up because it didn't make sense to me.  I've written perhaps
500 lines of assembly in my life.

>Things like dictionaries are good for non-programmers to get things done,
>it's good for a simple solution but can not be transformed in a way that
>are simply turned into an R\BST when the requirements change.

I still use dictionaries, heavily.  For commentary, see


>Again, depends on what kind of view one has of teaching and learning, my
>view is that the students should teach them selves, and that is best done

I taught myself programming.  I learned with BASIC, which effectively
had two data types: number and text.  I didn't know the difference
between an integer and a real (they're just numbers, right)?  Eg, I
recall wondering why I couldn't stick things into an array at position
arr(1.2) -- why was that the same as arr(1)?

This from a person whose first non-trivial code was a program to
compute gcd and lcm.  It wasn't until I was 16 when I started using
QBASIC where I could specify data types, and I did so only *after*
I wrote the code and wanted the performance.

Ada, as I recall, doesn't have that flexibility.  So I figure it
would have been that much harder for me to figure things out.

Part of my job now is getting research scientists to figure out
that programming is fun.  These are people usually with a PhD in
chemistry, physics or biology who have had a bit of C or FORTRAN
training and on-the-job learning of shell programming.  I've
seen them learning different languages (C, C++, Tcl, Perl, Python,
and a slew of domain specific languages).  Of those, Tcl and Python
make the most sense to them.  Things like the interactive mode,
strong dynamic typing, exceptions, gc, readability, and a practical
view of the world make things easy enough for them.  Of those,
Python is the only one that programmers also enjoy.  So I code
in Python.

I can't imagine teaching them Ada.  I've read through an Ada
primer.  It didn't give me anywhere near the joy that reading the
Python tutorial gave me.

Though 'tis true, they aren't children, so I've strayed off topic.
I can't imagine learning Ada on my own in 7th grade.  I could
have done Python, except I would have needed a better editor than
Python's current text version.  BASIC with line numbers
makes it possible to edit a single line of code.

Not sure about the current IDEs either.  I heard one talk where
the presenter chose Tcl (withone of the object extensions) over
Python because it was easier for her coworkers to change a single
method interactively, rather than having to reload the whole
module, with all the trickiness that entails.

                    dalke at dalkescientific.com

More information about the Python-list mailing list