[Edu-sig] Why choose Python (subtitled: the lure of the tool)

Peter Bowyer peter at mapledesign.co.uk
Wed Oct 19 10:25:12 CEST 2005


As you may remember from previous posts, I am researching ways to 
improve the teaching of programming to physics students.

In the past as with most physics departments the course was taught as 
an introduction to C or Basic.  This worked fine up to the late 90s 
when most students had experience of programming.  The structure here 
has been to have an introductory course in the 2nd year teaching 
people how to program, and then an optional course in the 3rd year 
introducing computational physics.

My idea was to teach the basics using Python and scientific 
modules.  However, the question I am consistently coming up against 
is "Why not teach the students Matlab?".  It's a very good point and 
one I can think up no clear answer for.  If the students stay in 
Physics or a related field they will be using Matlab (and 
C/C++/Fortran if needed).  therefore is there any reason not to teach 
this as the introduction to programming?

My arguments at present are that Matlab is a proprietary tool so the 
cost to students in obtaining copies will be not inconsiderable 
(considering it will only be used for a short course), and that 
Matlab is a specialised tool, so those not interested in going on 
into a physics related field will not find it of any use (unlike Python).

The arguments for Matlab are stronger:
1) It's a standard tool, widely used
2) It is easier to install and maintain (discounting the Enthought 
edition for a moment, Python is CRAP compared with other langauges - 
where is the Package manager to make life easier?)
3) The editor has a good interface (v7 and above) which IDLE lacks 
(no data inspector 'right there')
4) Integrated help for all the scientific functions

Are there any reasons you can think of that Python makes a better 
choice than Matlab?  I myself would far rather use Python (I have 
ideas about how VPython can help the students understand Python) but 
need a more robust reason than a handwaving argument about 
"3D...easier for students to visualise...".

Toby Donaldson made a good point in his post on 17/10/05:
>Python's a good choice of language when you want to talk about
>"programming as computation" to people who don't have a lot of CS or
>math background. It's also good for talking about algorithm
>correctness. And I use it all the time as pseudocode and one-shot
>It's not so good for talking about "programming as exploiting your
>computer", i.e. when it comes time to implement an algorithm

The people doing my course know absolutely nothing about programming, 
but at the same time being physics, every member of staff mentions 
efficiency in the same sentence as programming :-)  With that said, 
now the grounds are switched from teaching C/Python to Matlab/Python 
it doesn't appear to be such a valid argument.


Maple Design - quality web design and programming

More information about the Edu-sig mailing list