[Tutor] Python as Teaching Language

Alan Gauld alan.gauld at btinternet.com
Sun Jan 19 21:45:26 CET 2014


On 19/01/14 19:18, Keith Winston wrote:
> On Sun, Jan 19, 2014 at 11:55 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>> It has reached the point that I'm back to looking for a new teaching
>> language. ...
>>
>> But what else is there? that's the problem.... :-(
>
> Hi Alan, since this is off-topic from it's original thread, but I
> wanted to respond to it, I popped it into a new thread, I hope you
> don't mind (original was subject "iterators").

Not at all, I probably should have done that myself.

> I can imagine what you mean about a teaching language, and while I
> don't 1) teach CS or 2) know Python like you do... AND I don't know
> the alternatives... it still feels like the cleanest, most
> user-friendly language I've ever worked with.

I agree although I don't teach CS and don't consider myself a Python 
guru by any means, but I have been programming for 40 years in
over 20 languages so I do know a bit about the alternatives! :-)

> something to be said for letting novices play with real tools: instead
> of coming to the end of their one-semester computer class feeling like
> they just played with legos, they can feel like they got some (minor)
> feel for building a house.

Absolutely, and that's why I first chose Python for my tutor.
I needed a language that students could go away and actually
use for real work - unlike Logo, or even Lisp and Smalltalk.
(I know you can do real work in all of those but they are
hardly mainstream, and the leap from learning to practicality
is quite big IMHO)

> An interesting question is, what's the goal (for those students,
> probably the majority in a required comp sci course) who aren't going
> to do a lot of programming in the future?

I hope CS students will be doing a lot of programming! :-)
But the target for my tutor was that group who had no formal
CS training, and indeed no math training beyond high school,
but needed to program to achieve their objectives. Think
IT operations staff or sys admins or even non CS academics
doing stats etc (This was pre R of course...)

So I needed to be able to avoid technical concepts and yet
be able to back-fill those concepts when needed. Python did
that in v1 and to a lesser degree in v2. But in V3 too many
of the academic features seem to escape from the shadows and
hit the newbie in the face.

> fields... Anyway, I'm sorta loving this language, and it feels like a
> decent way "in" to all of those goals.

I still love Python as a language for my own use.
In fact I'm currently working on another book just now that's
focused on using Python in practical contexts, but it's not
a pure beginners book. And it would be much harder to write
a pure beginners book now than it was 15 years ago when I
did my first. There is so much more to explain to get quite
basic things done.

> There are two caveats: one is, without this tutor list (and to a
> lesser extent, perhaps because I've relied on this so much), other
> online resources (stack overflow, the Python IRC channels, etc), it
> would be much harder to make sense of. But those are there, and don't
> seem in immediate danger of disappearing.

The internet has changed how people learn. Wikipedia is a fantastic 
resource for the pure theory type stuff and user fora are great for 
practical help - although often with as much bad advice as good! Just 
because something works doesn't make it right! But the days of hunkering 
down with a single text book and bulldozing your way
through are, thankfully, long gone.

> And the second... the documentation. I really want to love the
> documentation, but I can't.

You should try learning C or Fortran from the DEC VAX manuals! :-)
The Python docs are a model of clarity. But you do know how
to read them. They are written for professionals.
One of the primary targets of my tutor was to explain all of
those concepts needed to read the docs and understand them.
In that I was only partially successful.

> (if I'm trying to find something in the documentation, I almost always
> search it from Google),

So does everyone else. Python was created in the internet age.
Search engines were assumed to exist and users were expected to
use them.

> it often doesn't give any examples

Yes thats one area that could be im[proved. The subprocess model is one 
exception. I think it would be great if every module page had an 
accompanying examples page. But no, I'm not volunteering to write
them! :-)

And there's the rub, everything in Python is done by volunteers.
Who wants to spend there day writing examples for a manual page
when they could be writing real code?
Getting volunteers to document Open Source projects is always a 
challenge. Python is better served than many. Commercial projects
hire professional Technical Authors to wrie the docs and thus
tend to be of much higher quality. But you often pay as much
for the docs as for the software!

> learning process which involves not understanding a disconcerting
> amount of what's in front of me.... the slow, plodding
> forward approach that is the alternative generally offered.

You are not alone. I'm of the slow plodding variety, but many people 
prefer the Dive In approach. But I *hate* doing things I don't 
understand first. (I always read the manual for things I buy before 
switching them on...or at least the section up to where it tells you how 
to switch it on! :-)

> more novice than me) people bring here are things like error statement
> meanings, etc. In many cases IMO, the first 10 minutes of frustration
> around something like that can be enough to leave a lasting bad taste.

Yes, and it's in those error statements that beginners hit the
under-belly of Python. iterators and range objects etc are fine
and you can ignore them most of the time. But if a newbie gets
an error message referring to range objects or iterators and
they don't know what it means it freaks them out! tracebacks
are great for programmers but absolutely horrendous for
normal users.

I have one friend who got a fairly innocuous traceback from
a program I wrote for her and she immediately switched off
her PC and refused to turn it on again until I came over
to confirm that the message was harmless (2 days later as
it happened). (Blue screens of death on Windows have the
same affect which I assume is why Microsoft seem to have
replaced them in Win8 with a totally bland purple screen
of death that just says something like 'It's broken, start
again'...)

> And a last note on feedback: having the interpreter available is a
> definite plus for Python, though learning to disassemble one's
> confusion into little pieces that you can test methodically is hard.

Yes, and another reason I chose Python. I first learned to program at
high school, in BASIC and later Pascal, on a University mainframe.
We punched code into a paper tape and posted it to the University
who posted back the results 3 days later. ('Missing semi-colon: line 5')
This was not an ideal learning environment! (But it sure made you
check your syntax! :-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list