[Edu-sig] re: Python as a first-year programming language

Toby Donaldson tjd@sfu.ca
Mon, 28 Apr 2003 01:37:14 -0700


> >One of the problems I have about acceptance of Python is that the choice
> >of first-year programming language is likely to be a group decision, and
> >Python, for all its merits, is either unknown, or has a reputation as
> >being "just a scripting language", or just a new version of BASIC. Such
> >innuendos unfortunately often carry the day in many academic
> >departments, as nobody but the teachers of the programming class will
> >have time to actually evaluate the different languages. Who says
> >academia has no pointy-haired bosses? :-)
>
> Seems to me that the fact that Peter Norwig chose to illustrate
> the algorythms of
>
>
>   Artificial Intelligence: A Modern Approach
>
>
>       Second Edition
>
> by *StuartRussell <http://www.cs.berkeley.edu/%7Erussell>* and
> *PeterNorvig <http://www.norvig.com>*
>
> in Python should say a lot to some of these folks.
>
> http://www.norvig.com/python/python.html
>
> Art
>
> PS      Not to worry, I'm handling the errata ;)

The problem with AI is that it is too complex for beginning programmers. I
have enough trouble teaching it to graduate students. :-)

I've used some of Norvig's code in a planner I've written in Python. It's
been *great* for prototyping, like Scheme in many respects, but easier to
read and write. Is there any way in Python to implement non-deterministic
programming, e.g. for backtacking? It would be nice to be able to write
something like this:

  def triple(a, b, c, n):
    a = choice(n)    # choice non-deterministically chooses a number from 0
to n-1
    b = choice(n)
    c = choice(n)
    if a**2 + b**2 == c**2:
      return a, b, c

More practically, what would help sell Python as a teaching language at my
university is:

  - good textbooks for it, including exercises with answers, labs,
self-tests, etc. (when there's 200+ students in one class, you need
self-contained materials)

  - explanations of the advantags it gives to "CO-OP" students, i.e.
students who alternate school terms with work terms; the practicality of
Python is key to selling it to student, parents, advisors, and employers,
although a common argument is that we should be teaching the exact same
languages that CO-OP employers use (I don't agree with that argument, but
it's made all the time)

  - explanations of how it impacts later traditional computer science
courses, such as data structures and algorithms, operating systems,
graphics, etc.; there's FUD among some that teaching students a "weird"
language hurts them in later courses

Toby