Python + XML = wary coexistence

There has been quite a bit of discussion triggered by my article "Python and XML: Should Python and XML Coexist?". This sort of thing always surprises me more than it should. I like to post code-heavy articles and leave the philosophy to the occasional entry, or to this very Weblog, but it seems that people respond more vocally to philosophy than to code. Perhaps I'll discuss with Kendall, my editor, what this suggests in terms of future directions for my Python/XML column.

Anyway, first I point to PJE's response. I used quotes from his Weblog as jumping-off points for my article.

Uche Ogbuji liberally quotes from and analyzes two of my XML-v.-Python rants, and actually gets it completely right. Since at least one of those rants has been cited as meaning I think XML is the spawn of Satan, I'm glad Uche read closely enough to get the context and nuance, without projecting things into it that I didn't say. Kudos!

I don't claim to know whom PJE speaks of when he refers to other commentary on his rant, but Martijn Faassen indicated his own response. I do think that Martijn missed some of PJE's intended nuance, but to be fair, it took me more than one reading to catch that nuance. I think that PJE could have saved himself a lot of misunderstanding, but hell, I've had my turn at thickly nuanced rant myself, so I see both sides. Looking more broadly at the landscape, Martijn puts succinctly what I've said in the past.

This disdain for XML technologies is very common among Python programmers.

But maybe that means something greater than petty rivalry. Mike Champion brought up my article on XML-DEV:

For some time now we've seen the JSON "fat-free alternative to XML" direction that some in the AJAX world are taking to address both XML's inefficiency and the mismatch with programming languages. Now I see that many in the Python community have a similar attitude toward XML and encourage its use only when necessary to exchange data with non-Python apps.

He followed with a list of thoughts, touching on the likely roles of JSON, Python, XML, and more, and I responded. To much to quote from the exchange. Read the originals yourself, if you like. I will mention the final thought in my response:

In many ways I think a vicious backlash from programming languages against XML is just what XML needs right now.

In saying that, I had in mind some of my other prosaic articles about the direction of XML, including:

I think that many XML folks have been working to encroach on the territory of languages such as Python, even if Python folks aren't always clear on this fact while complaining about XML. We'll just have to see how it all shakes out. I know what pattern of tool usage I'll stick to for now. Speaking of omni-tools, Dimitre Novatchev put in a plug for XSLT as general-purpose programming language, which he's also done here in Copia comments. I still think it's a bad idea to treat XSLT as anything other than a template language. XSLT in its place, Python (or Javascript, Ruby, or whatever) in its place.

In the comments on my article there are some interesting bits, including one correspondent's mention of the importance of open file formats, and the XML's role in this, followed bewilderingly by:

C++ is so powerful that with the right classes, many of the advantages of a scripting language are attainable.

Sounds like someone who badly needs to actually try Python.

[Uche Ogbuji]

via Copia
4 responses
I think for PJE to speak about people detecting (or not) 'context and nuance' in what amounts to a rant is a bit confusing. I appreciated the rant quite a bit, but the exact thing that was missing from it was context and nuance; it wouldn't be a good rant otherwise. As he says in a comment to my article, his position is more nuanced than his tone was.

The one bit of context I got before he actually

announced it was that he was probably looking at the Chandler source code... :)

I'd seen the XML bit of his "Python is not Java" post quoted by a few other other Python programmers, and I was responding to people who picked up on that bit. The problem I have is more with the tone than the content. XML is certainly far from a panacea, but  it cannot be ignored either. My problem with the rant, and the way the rant was being picked up, is that his tone is giving an excuse to other Python programmers to ignore XML with disdain. I don't believe that's an attitude that is useful.

Finally, I also hope the backlash to XML can be kept from being too viscious. Viscious backlash to me has a connotation with uninformed lashing out, while what is needed is constructive, though strong, criticism.
Well put, Martijn.  You really should post this on your Weblog.  As you said about your other posting, it doesn't deserve to be buried in comments to another article.
Excuse a little flippancy, but that last correspondent is perfectly correct. The first thing you do is write a Ruby interpreter...
Python is not Java ???? What in the world does this have to do with XML ?!? Perl processes XML. C# processes XML. Do we need to say Python is not Perl ? Not C# ? There are umpteen ways to process XML. XML is a META LANGUAGE for describing structured data. It is bound to NO one particular programming language. A dislike on the part of Python programmers is a lie. I am working on Wall St, financial applications processing XML. We've got Perl, C# and Python scripts working well on my project. No-one dislikes XML. We also like HTML, Ebcdic coded text, Ascii coded text and Unicode. We don't dislike a paint-brush because we don't like painting.