[Edu-sig] Re: Python Anxiety

Kirby Urner urnerk@qwest.net
Sun, 06 Apr 2003 00:52:26 -0800


Here was my reply to Shelley, for which she has since thanked me (and
given permission for me to share this correspondence).

===============

Date: Sat, 05 Apr 2003 17:20:54 -0800
To: Shelley Walsh
From: Kirby Urner <urnerk@qwest.net>
Subject: Re: Python Anxiety


Thanks for your interesting letter Shelley.

If you're willing, I'd like to post it to edu-sig, the Python mailing
list re Python in education.  Or perhaps you'd like to subscribe to it,
as here's a community of people interested in this goal.  See:
http://www.python.org/sigs/edu-sig for more info.

Re your specific questions, I have to confess up front that I have
very limited personal experience trying to phase in Python in the ways
I suggest.  I would *like* to have more of these opportunities, but the
fact is that I am not now a classroom teacher (I used to be, but that
was many years ago).  When I do get together in a room to present
Python or Python-related topics, chances are they're already sold on
the program -- I'm mostly just preaching to the choir as it were.

With that confession out of the way, I will attempt to give you some
feedback.

I think you're encountering two different reactions here, when you
talk about (a) trying to teach Python to students who may already
have some C++ or Java experience versus (b) showing off Python's
potential utility as a math-teaching aid to faculty members in a
mathematics department.

In the former case, there's some chauvinism in the various language
communities.  C++ and Java both take longer to become productive in
than Python, and are better established in the commercial sector.
Python does enjoy a growing following on many fronts, but it's not
atypical to encounter dismissive attitudes amidst those who've already
made considerable investment in another language.  My riposte is that
anyone serious about programming needs to keep an open mind and
appreciation for multiple languages.  The idea of a "monolingual
professional programmer" is something of an oxymoron.

More specifically, to C/C++ people I'll point out that Python is
open source, written in C, and extensible in C/C++, so if you have
C/C++ skills, you have lots of opportunities in the Python
community, which is inhabited by a great many accomplished and
sophisticated C programmers (Python being a wonderful example of
C's capabilities).  To Java people, I'd point out Jython, a version
of Python implemented entirely in Java, and through which one has
interactive access to the complete Java class hierarchy.  Serious
Java programmers needn't leave Java behind in order to avail them-
selves of Jython's power, and should realize that schools using
Python and Jython are not necessarily competing with the Java
community -- on the contrary, they're helping to train a next
generation of Java programmer.

Also in this context, I might direct these skeptics to Bruce Eckel's
web site:  http://www.mindview.net/.  Here's an excerpt from an interview
at this site, which you might find interesting, given your own experience
with distance education:

    One of the things I'm working on now is a distance-learning
    program for people who want to learn to program using Python.
    I think it will be a much faster and more efficient way for
    people to come up the learning curve. This is still in the
    formative stages; as you might have guessed by now I generally
    think about something for awhile before the right approach
    comes to me.

    Once you've had success with programming and are comfortable
    with objects, then you're ready to tackle a language like C++
    or Java, which is heavier weight and has more arbitrary
    details for the programmer to master (or become confused by).

    [ http://www.mindview.net/Etc/About/InformITRaw_html ]

So here's a guy with some very deep and meticulous books on both
C++ and Java -- who now advocates Python as his current language
of choice.  Again, Python is not just some toy academic language,
nor just a "scripting language" beneath the dignity of serious
programmers.  It's a very high level general purpose language,
and learning it first can make Java and C++ a lot more accessible
-- as second or third languages.

But with the math teachers, I think the reaction is coming from a
different place.  If they're horrified by the colon and the return
keyword in Python, they'll be even more horrified by all the
syntactical clutter of *any* computer language -- even Mathematica,
which has gone a long way to accommodate traditional math notation.
But as Wolfram points out, traditional notation is ambiguous.  Does
s(x-1) mean the function s, applied to x-1, or does it mean s times
x-1?  In Mathematica, when a function is being applied, we use
square brackets exclusively, while curved parentheses serve to
indicate the order of operations.  Whereas humans can tolerate a
lot of ambiguity, owing to sensitivity to context, computers cannot.
And so in a lot of ways, computers force *more* precision on a
notation.

With math educators, it does no good to talk about Python's power
and sophistication vis-a-vis C++ and Java.  Their beef is with the
whole idea of diluting the purity of their discipline with material
from an alien discipline, i.e. computer science and/or engineering.
To start using a computer language in an early math curriculum
looks like the harbinger of nothing good:  it means math will
become mixed up with all kinds incompatible grammars which come
and go, vs. the staying power of a more stable, core notation.
Plus if computer languages invade the math classroom, then
teachers will be forced to learn programming, which many are
loathe to take up.  The hand held graphing calculator is as far
into computing technology as these teachers want to go, and even
there, their programmability is often ignored.

But not all math educators are on the same page here.  Many
recognize the advantage of having an "executable math notation"
vs. one that just sits there on the printed page, doing nothing
(except crying out to be deciphered).  Kenneth Iverson makes this
point very clearly when he writes:

   It might be argued that mathematical notation (to be referred
   to as MN) is adequate as it is, and could not benefit from
   the infusion of ideas from programming languages. However, MN
   suffers an important defect: it is not executable on a computer,
   and cannot be used for rapid and accurate exploration of
   mathematical notions.

          Kenneth E. Iverson, Computers and Mathematical Notation,
          available from jsoftware.com

It's this ability of computer languages to promote the "rapid and
accurate exploration of mathematical notions" which some of us find
exciting and empowering (and if you want to impress math teachers
with a wholly alien notation, which nevertheless expresses a lot
of the same ideas (sometimes as generally and formally as any
traditional notation), have them look at APL or J).

Furthermore, one might argue that imparting numeracy is *not* limited
to teaching just those topics and notations most traditionally
favored within mathematics.  It's about imparting some familiarity
and comprehension around *whatever* happen to be the culture's
primary symbolic notations (music notation included) beyond those
which we group under the heading of literacy.

We need to provide some exposure to computer languages because our
industrial society is completely dependent upon them, because they've
become ubiquitous.

We have the choice of segregating these topics from mathematics, just
as we've divorced mathematics from the physical sciences.  But some
educators in every generation advocate curriculum integration through
cross-pollination, and to such educators, it makes perfect sense to
meld computer topics with math topics, with science and even humanities
topics (cryptography is a good example of where all of these converge).
In my view, the benefits to be obtained through synergy outweigh the
arguments of turf-protectors who would keep their respective
disciplines "pure".

That's the kind of overview debate I think is going on here.  Then
come the more specific points about the advantages of a computer
language such as Python, versus the calculators, which are already
pretty well established.  Python's abilities with big integers are
another selling point.  Even though some calculators can work with
100-digit integers, they have a lot more trouble displaying them
(more an argument for a big screen over a tiny one).

The ability to scroll back through a work session is another advantage.

And I think algorithms which involve alphanumeric processing, not just
numeric processing, should get more central treatment, including in
mathematics.  For example, it's fine to express permutations using
integers only, but for applications purposes, it's best if we can map
1-27 to the 26 letters and a space.  Then you can see how a permutation
results in a scrambling of the alphabet -- back to cryptography again
(I recommend Sarah Flannery's 'In Code' by the way -- she's very clear
about how important Mathematica was to her conceptual development --
which isn't the same as Python of course, but some of the same
synergies apply).

Thanks again for your interesting letter.  If you give your permission,
I'll post it, along with my response, to edu-sig, in hopes of generating
more discussion along these lines.  Or again, perhaps you'd like to
subscribe and make a fresh start.  I think the attitudes you're
running up against are not unique to your experience and it might
benefit a lot of us to take part in more of such discussion.

Sincerely,
Kirby