Python's "only one way to do it" philosophy isn't good?

Douglas Alan doug at alum.mit.edu
Wed Jun 20 17:09:00 EDT 2007


Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> writes:

> On Tue, 19 Jun 2007 20:16:28 -0400, Douglas Alan wrote:

>> Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:

>>> On Tue, 19 Jun 2007 17:46:35 -0400, Douglas Alan wrote:

>> The problem with using Scheme for real work is that it doesn't come
>> with enough batteries included and there isn't a big enough of a
>> community behind it that uses it for real work.

> And yet there have been so many millions of dollars put into
> developing Lisp...

> I guess this is another example of perfection being the enemy of the
> good.

That's probably a valid criticism of Scheme.  Not so much of Lisp in
general.  The reason that Common Lisp hasn't been widely adopted
outside of the AI community, for instance, has more to do with most
programmers apparently not understanding the joys of Cambridge Polish
Notation.  Also, Lisp was garbage-collected back when
garbage-collection had a bad name, due to it being considered a
resource hog.  And then a large part of the Lisp community decided to
concentrate on building special hardware (i.e. Lisp machines) for
developing Lisp applications, rather than making good Lisp development
environments for Fortran/C machines (i.e., all normal computers).

It was clear to me at the time that it's a very hard sell to convince
people to buy expensive hardware to develop in a programming language
that hasn't yet been popularized.  But apparently what was obvious to
me was not so apparent to those who dreamed of IPO riches.

> All that development into Lisp/Scheme to make it the best, purest,
> most ideal programming language, with such flexibility and
> extensibility.  that nobody wants to use it. You can write any
> library and macro system you need, but nobody has.

Lisp in general has had all sorts of fancy macro packages for it since
the dawn of time.  But Lisp wasn't really standardized until Common
Lisp in the early '80s.  CLOS (the Common Lisp Object System), which
is implemented via macros entirely within Common Lisp itself, was
completed in the latter half of the '80s.

> I don't mean literally nobody, of course. Its a figure of
> speech. But it seems that people tend to program in Scheme for fun,
> or to stretch the boundaries of what's possible, and not to Get The
> Job Done.

Well, most implementations don't have batteries included, the way that
Python does.  Guile attempts to, as does the Scheme Shell, but for
various reasons they didn't catch on the way that Python and Perl and
Ruby have.

>> Well, go to MIT and take SICP and then the graduate-level sequel to
>> the class, Adventures in Advanced Symbolic Programming, and then
>> you'll see what some of the advantages would be.

> Are you suggesting that the only way to see the advantages of Scheme
> is to do a university course?

No, I was just suggesting *one* way of seeing the light.  I think,
though, that it's probably difficult to grasp why Scheme is so
interesting without taking a good class or two on the topic.  Not that
acquiring insight on one's own is impossible, but most people would
also have a hard time seeing why group theory or linear algebra are
really interesting without taking good classes one the subjects.

Python doesn't really require taking a class in it because it's really
very similar to many other programming languages.  So if you already
know any of the others, Python is very easy to pick up.  Scheme, on
the other hand, is more of a departure from what most people would
already be comfortable with.

>> A good multimethod system, e.g., would make Python a significantly nicer
>> language for my purposes, for instance.

> http://en.wikipedia.org/wiki/Multimethod#Python

Sure, you can do it in Python, but I bet that it's neither very fun,
nor efficient.

>> For the record, I have a huge problem with NIH-syndrome, and think that
>> every programming language in the world could learn a thing or two from
>> what other languages have gotten right.

> Of course. And Python, more than most, has shamelessly copied
> features from other languages.

To make myself a bit more clear, I don't think that Python suffers all
that much from NIH.  On the other hand, I think that many people in
discussion forums in general often do.  Here being no exception.

> So the question is, are Scheme macros one of those things that
> "other languages have gotten right"? Could they be a case of
> over-generalization? Or somewhere in between?

I don't know of any language that is not a dialect of Lisp that has a
good syntax extension mechanism.  Lisp dialects tend to get it right,
more or less, but solving the issue is much more difficult for any
language that doesn't have a Lisp-like syntax.  Lisp's syntax is
particularly amenable to syntax extension.

|>oug



More information about the Python-list mailing list