[Haskell-cafe] Python?

Donn Cave donn at drizzle.com
Wed May 11 01:43:47 EDT 2005


Quoth Daniel Carrera <dcarrera at digitaldistribution.com>:
...
| I have a lady friend who wants to learn how to program. I just decided 
| to teach her Python for practical reasons:

I think when you factor in practical reasons, it makes a lot of sense.
Python's simplicity and suitability for beginners is vastly overrated,
but it's no worse than any of its competition and better than many.
It has good exception handling and the top level handler prints out a
traceback, I think that's very instructive.

As for Objective CAML, it is as someone suggested somewhere in the more
practical direction (I haven't checked, but likely enough it does build
just fine on Solaris.)  And it's a bona fide FPL, plus an interesting
OOP layer.  Has a lot going for it, but for me it's just no fun.  The
syntax has something to do with that.

| So I'm thinking that perhaps I can use Python, but try to teach her 
| functional principles, like not changing the value of a variable and not 
| letting her functions have side-effects.

You'll teach her to resent these restrictions.  Haskell is built
to make the most of that style of programming, Python isn't.  It
does have some of that, though -- e.g., you can't modify a string.

But the first principle of FP might be "use functions", and that
you can impart.  Python programmers often could stand to break their
code out into functions.  You won't get to compose functions as you
would in Haskell (though it isn't clear to me that it's a big win with
beginners anyway), but Python does have the basics for functional
usage inasmuch as it can return multiple values, GC storage etc.

In the end though it's a classic OOPL and a rather feeble FPL, and
it seems to me kind of like teaching horsemanship with an oxe.

	Donn


More information about the Haskell-Cafe mailing list