Nice quote

Jeremy Bowers jerf at
Sun Mar 30 20:14:05 CEST 2003

On Sun, 30 Mar 2003 11:26:30 -0500, Peter Hansen wrote:
> Jeremy Bowers wrote:
>> You may consider XML processing not a particular pain but I think that's
>> more a personal judgment then anything else, because I don't see Python
>> granting a huge advantage over Perl.
> a) Of _course_ it's a personal judgment.
(and from later)
> (I've never understood why people think personal judgments, a.k.a.
> "opinions", are such a bad thing... every has them, but nobody likes
> :-)

I don't mean to imply that it is therefore invalid or bad, sorry. What I
mean is that it's not so clear an advantage that it transcends the very
fuzzy line between "personal judgement" and "obvious, if not really
'objective', fact". (An example of the latter is "For most programming
tasks, Python will result in shorter and easier-to-maintain programs than
C++ will." You can't really *prove* it, but for most practical purposes
it's true.) 

> b) I'm not clear why you think anyone was saying there's a "huge
> advantage" over Perl.  They weren't! (I suspect)

Logic like this:

1. (From Tim Bray) Current programming paradigms/libraries for XML suck.
2. (From Tim Bray) Python people report it is not a problem.
3. For the purposes of discussion, assume 2 as fact.
4. 1 & 3 -> Python must have an XML programming paradigm/library that 
   does not suck.
5. Such a library would be a "huge advantage" (my words) over Perl.

The hope that I would find out what this library/paradigm was is what
prompted my original post. Wasn't fruitless, as I was not as aware of
gnosis as I am now. (Had previously heard of the xml.pickle module but was
not aware it was part of a family of other XML tools.)

>  They simply were saying
> they didn't see there being a big problem in Python-land. If those who
> spend their time in Perl-land complain a lot more than those in
> Python-land, perhaps one can start to draw some conclusions, but one of
> those might simply be that Perl-folk are so stressed they need to vent
> some anger, while Python-folk are pretty happy in their daily lives. :-)

Once I get the data into the Python program I am happier; if that's all
the Python people were getting at then I am somewhat disappointed. I
suspect Tim Bray will be as well, since IMHO he was clearly complaining
about libraries, and if he does learn Python hoping to find something
better, IMHO he's going to end up disappointed to find out that's all the
"Python people" were referring to. 

Ironically, I would have *expected* that the Python community would be
that much more likely to try to come up with and embrace a better XML
parsing solution, as the current SAX/DOM approaches are that much uglier
by contrast to the rest of Python code. In Perl it fits in better with the
generally cruftiness... seems the opposite has occurred and the language
compensates enough for the cruft in SAX/DOM that it doesn't cross the
irritation threshold.

(For what it's worth, my original posting is prompted by the fact that I
intend to write a program in the near future that will want to be reading
effectively arbitrary document XML formats, up to and including the, shall
we say, "well-marked up" contents of a Microsoft Office XML document. I'm
going to need all the power I can get, because time will be money.)

>> At best Python XML processing is at most a small linear improvement over
>> Perl.
> That sounds very much like a personal judgment to me. <wink>

But tending toward the "obvious fact" side, as described above, though not
quite making it. A SAX-based parser in Perl and a SAX-based parser in
Python are going to be the same basic size, to within some linear factor,
if they are both doing the same thing. Post-parsing data structures may be
nicer in Python, but that's a reflection of the language, not the parsing

A lot of people misinterpreted both of the Tim Bray pieces quite badly
(see the Slashdot discussions on both articles for proof). My conclusion
is that the "Python people"*, whomever they were, misinterpreted the first
article as complaining about the final output of SAX/DOM approaches rather
then the SAX/DOM approaches themselves, and that Python does not, with the
possible exception of gnosis.xml (which I can't judge thoroughly as I
haven't used it yet, though I feel confident the API is better then DOM),
have any better solutions to the act of parsing XML then any other

As always, YMMV and I'm not trying to push that conclusion down anybody's
throat. ;-) And I'd like to wave my creds around as a bona-fide Python
advocate; I'm not trying to dis Python, it's my favorite language, I just
think that the claims someone made to Tim Bray were probably not correct,
just as "Pure Python is the best solution for every programming problem"
is not correct.

*- A reminder that by "Python people" I mean the ones Tim Bray was
referring to in his post, who reported that Python has no problems with

More information about the Python-list mailing list