Experiences/guidance on teaching Python as a first programming language

Chris Angelico rosuav at gmail.com
Wed Dec 11 07:35:49 EST 2013


On Wed, Dec 11, 2013 at 10:46 PM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> This definitely wouldn't work for my students but a friend of mine
> studied CS (at Warwick?) and his course worked as Dijkstra describes.
> In the first year they don't touch a real programming language or
> write any actual programs. They take exams in pseudocode and formal
> proofs of correctness. Then after a year of studying algorithms,
> linguistics, semantics, proof, mathematics and so on they write their
> first hello world program in a real programming language. I don't
> really know whether he's any good at programming but he's certainly a
> good mathematician.

Yeah, that's how that sounds. If programming is, to your students, a
tool for mathematical analysis (if code is a kind of super-algebra),
then it's right to take eams in pseudocode and study algorithms before
writing hello world. But if programming is a means of gaining command
of a computer, it's far better to see some results of that. Some
people like the idea of creating games (usually because they've played
so many), so there are courses around that take you from knowing
nothing about code to creating your first game (often in one of those
systems that lets you build an application without writing code,
though, in which case it's not really teaching programming at all).
Personally, I'd rather focus on something that's universal[1] (the
console and "Hello, world!"), but I do see the appeal of "And by the
end of the course, you'll have created a playable game!".

Early in my computing days, I met REXX, and a program called REXXTry.
It provided a basic Read/Eval/Print loop, though the Print part wasn't
very sophisticated (though since REXX didn't have much in the way of
complex types, all that meant was that the display of long strings was
a bit ugly). I ended up creating an Extended REXXTry, partly by adding
a sophisticated input routine courtesy of REXXTT, and then by adding a
pile of custom functions - with the goal of making it the ultimate in
algebraic handlers. It was, in fact, quite a reasonable tool for
playing around with maths; I could sketch a geometric problem on
paper, figure out what I knew and what I needed to know, key stuff
into EREXXTry, and get a result back. Python could do exactly the
same, only way way better (already has support for fractions and
complex numbers, which REXX doesn't), and that would make a fine
introduction to programming... for someone with a background in
algebra.

Different styles for different origins.

ChrisA

[1] Or nearly so. Ironically, many of the systems that don't have a
console available are called "consoles". <voice imitate="Jubal
Early">Does that seem right to you?</voice>



More information about the Python-list mailing list