Python: Steaming pile of dinosaur dung?

An excerpt from a conversation on sci.math
(Message-ID: <qfhf00pi1ilingf3fsu77pmrvjs6vs3s9p@4ax.com>):

On 15 Jan 2004 10:39:26 -0800, tb+usenet@becket.net (Thomas Bushnell,
BSG) wrote:

>David C. Ullrich  writes:
>
>> This is _Python_, an extremely fabulous language, but
>> quite slow, being interpreted instead of compiled. 
>
>I don't think you can prove programming skill by saying crazy things
>like "Python is an extremely fabulous language".  Sorry.

Well, I've already suggested that you should explain what your
reasons for this are. It occured to me that I instead of trying to
explain what's so great about Python I should just give a citation
to someone else's explanation.

I'm not an expert programmer, never claimed to be. On the
other hand Eric Raymond is a _hugely_ respected name in
open-source programming circles. Go here to see what he
has to say about Python:

www.linuxjournal.com/article.php?sid=3882

A few quotes. First, just to show that he's not like the guy
who wrote Python so he has a vested interest or something,
he was very skeptical at first:

>"I immediately tripped over the first odd feature of Python 
>that everyone notices: the fact that whitespace (indentation) 
>is actually significant in the language syntax. The language 
>has no analog of the C and Perl brace syntax; instead, 
>changes in indentation delimit statement groups. And, like 
>most hackers on first realizing this fact, I recoiled in 
>reflexive disgust. 
>
>        I am just barely old enough to have programmed in 
>batch FORTRAN for a few months back in the 1970s. Most 
>hackers aren't these days, but somehow our culture seems 
>to have retained a pretty accurate folk memory of how nasty 
>those old-style fixed-field languages were. Indeed, the 
>term ``free format'', used back then to describe the newer 
>style of token-oriented syntax in Pascal and C, has almost 
>been forgotten; all languages have been designed that way 
>for decades now. Or almost all, anyway. It's hard to blame 
>anyone, on seeing this Python feature, for initially reacting 
>as though they had unexpectedly stepped in a steaming pile 
>of dinosaur dung."

He didn't start this project determined to like Python, his first 
reaction to one of the aspects that a lot of people find strange
at first was "steaming pile of dinosaur dung".

A lot of people who haven't _used_ the language react that
way. Now read what he has to say a little later, when he
has some experience with the language (and note how
much experience I'm talking about):

>"Of course, this brought me face to face once again with 
>Python's pons asinorum, the significance of whitespace. This 
>time, however, I charged ahead and roughed out some code 
>for a handful of sample GUI elements. Oddly enough, Python's 
>use of whitespace stopped feeling unnatural after about 
>twenty minutes. I just indented code, pretty much as I would 
>have done in a C program anyway, and it worked. 
>
>        That was my first surprise. My second came a couple of 
>hours into the project, when I noticed (allowing for pauses 
>needed to look up new features in Programming Python) I was 
>generating working code nearly as fast as I could type. When 
>I realized this, I was quite startled. An important measure 
>of effort in coding is the frequency with which you write 
>something that doesn't actually match your mental
>representation of the problem, and have to backtrack on 
>realizing that what you just typed won't actually tell the 
>language to do what you're thinking. An important measure 
>of good language design is how rapidly the percentage of 
>missteps of this kind falls as you gain experience with 
>the language. 
>
>        When you're writing working code nearly as fast as 
>you can type and your misstep rate is near zero, it 
>generally means you've achieved mastery of the language. 
>But that didn't make sense, because it was still day 
>one and I was regularly pausing to look up new language 
>and library features! 
>
>        This was my first clue that, in Python, I was 
>actually dealing with an exceptionally good design. Most 
>languages have so much friction and awkwardness built into 
>their design that you learn most of their feature set 
>long before your misstep rate drops anywhere near zero. 
>Python was the first general-purpose language I'd ever 
>used that reversed this process."

That's a few _hours_ of experience using the language, and his
opinion has changed from "steaming pile of dinosaur dung" to
"an exceptionally good design".

A few days later he's trying to do some "metaclass hacking"
(there's an explanation of what that means in the original),
and he determines that he can do things easily in Python
that he simply can't do at all in most languages, and
cannot do easily in _any_ other language that he knows
(he says he knows 20 or so):

>"This kind of thing is called metaclass hacking and is generally 
>considered fearsomely esoteric--deep black magic. Most 
>object-oriented languages don't support it at all; in 
>those that do (Perl being one), it tends to be a complicated 
>and fragile undertaking. I had been impressed by Python's 
>low coefficient of friction so far, but here was a real test. 
>How hard would I have to wrestle with the language to get it 
>to do this?
>        I knew from previous experience that the bout was 
>likely to be painful, even assuming I won, but I dived into 
>the book and read up on Python's metaclass facilities. The 
>resulting function is shown in Listing 3, and the code that 
>calls it is in Listing 4. 
Listing 3
Listing 4
>        That doesn't look too bad for deep black magic, does 
>it? Thirty-two lines, counting comments. Just from knowing 
>what I've said about the class structure, the calling code 
>is even readable. But the size of this code isn't the real 
>shocker. Brace yourself: this code only took me about ninety 
>minutes to write--and it worked correctly the first time 
>I ran it. 
>
>        To say I was astonished would have been positively 
>wallowing in understatement. It's remarkable enough when 
>implementations of simple techniques work exactly as 
>expected the first time; but my first metaclass hack in 
>a new language, six days from a cold standing start? 
>Even if we stipulate that I am a fairly talented hacker, 
>this is an amazing testament to Python's clarity and 
>elegance of design."

Could be that I'm not showing programming expertise by saying
crazy things like Python is an extremely fabulous language. If
so then _Eric Raymond_ is also revealing the same pathetic
lack of programming expertise. "[A]mazing testament to Python's
clarity and elegance of design" - what a moron.

(Just for the record, there's some stuff towards the end that's
out of date: He explains he'd still use Perl for small things
that use regular expressions heavily. Evidently he was using
an early version of Python - the regular expressions in
current Python are essentially identical to the regular
expressions in Perl.)

>c


************************

David C. Ullrich