[Edu-sig] Python as a first language for computer sciencist

Mark Engelberg mark.engelberg at alumni.rice.edu
Wed Oct 19 22:07:39 CEST 2005


On 10/19/05, Kirby Urner <urnerk at qwest.net> wrote:
> Technically speaking, there's no mistake here.  The coder created a local
> variable that went out of scope.  He could always say "I meant to do that."

Well, that's the point.  Python doesn't recognize it as a mistake. 
Clearly, in my example, the programmer intended to assign a new value
to an existing variable, rather than create a new variable.  Some
languages make a distinction between these two concepts, so the
language can flag this as an error.  Python doesn't make a
distinction, and therefore, a beginner programmer (and sometimes even
an advanced programmer) can create a semantic bug through a syntactic
mistake, and have an extraordinarily difficult time tracking down the
error.

This is not a desirable trait in a "first programming language" for
teaching computer science.

--Mark

P.S.  For what it's worth, Python is the language I choose to use on a
daily basis, because I mainly write short programs to analyze various
puzzles I'm working on.  It's a great tool for fast and practical
programming.  But I think it would be very hard to write a bug-free
large-scale project in Python.  (Granted, it's hard to write a
bug-free large-scale project in any language, but Python lacks the
facilities for verifying even the rudiments of correctness without
extensive run-time testing).  I'm undecided about how useful Python
would be as an educational tool.  Seems like it has some pros and
cons.  Since the pros have already been talked about, I thought it was
worth bringing up one of the major cons that I perceive.


More information about the Edu-sig mailing list