Teaching python (programming) to children

David Andreas Alderud aaldv97 at student.remove-this-part.vxu.se
Tue Nov 13 08:53:37 EST 2001


> 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.

And that's great, however, when I was teaching the 4:th graders they
constantly asked me on how computers worked, so I showed the everything from
the ALU of the CPU up to operatingsystem interrupts with the MC68k as a
base, naturally.
I'd say 85% of the 10 year olds got a pretty good idea on the subject
because they hardly ever asked and I heard them explain to students in other
classes, which was cool.

> 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.

I imagine it's hard to go from Python to any other language because it's
easy to become lazy, even I've become lazy.

> I still use dictionaries, heavily.  For commentary, see
>
> http://aspn.activestate.com/ASPN/Mail/Message/python-Tutor/538598

Ordinary hashtables are bad in worst case, i.e. no better than simple lists,
I normally design datastructures for a specific problem, though in all
fairness I once used Python to implement a DMBS when I first learned Python.

> 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)?

That's why BNF is so nice :)

> 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.

True, but there are nice packages for Ada which solve this with OO.

> 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.

The Python tutorial is nice, but I don't think it's fair to compare them as
they are intended for different audiences.

> 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.

I believe Python is a better choice than BASIC, though VB and BB are pretty
good for being BASIC.

> 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.

There is no absolute truth about what language to choose; I'd pick Ada, you
pick BASIC, and someone else would pick Logo.
The important thing is to get the student to code, without ever writing code
it doesn't matter what language one uses.





More information about the Python-list mailing list