Dennis Forbes on Pragmatic Software Development
Subscribe to RSS
 
Tuesday, November 14 2006

Every month or so, an anti-XML screed tops the rankings of sites like Digg. Thousands of users signal their agreement in a deafening clattering of keystrokes, emboldening the mighty warrior who dares to take on the cure-all, solve-all Goliath that is XML.

"XML is an ill-suited, jack-all-all-trades master of none overly-complex distortion of SGML!" they proclaim.

But why? Why the XML hate?

What did XML ever do to them?

Not All Technical Debates Are Actually About Technology

My cynical side wonders if some of the hate might be interpersonal issues disguised as technical conclusions.

In the latter half of the 20th century I was cursed with a pestering colleague -- a rather annoying sort who would spend weekends and evenings desperately working on a solution to try to outshine my deliverables, always demonstrating his proposal with the proclamation that he "did it in a few hours". This colleague suggested that I consider XML as an HTTP-delivered data stream between our own proprietary systems (an aggregation system and field collection systems).

I laughed him off, and began the process of inventing a long list of reasons why his suggestion was idiotic. "Imagine the bloat of XML!" I thought (sidenote: It would have been highly beneficial if the very first XML spec included basic, well-known and well-proven compression as a standard, optional element of XML. The SVG spec writers saw the value, as has Microsoft with their Office 2007 Open XML format. It would have been beneficial if every parser and library and validator automatically knew how to deal with compressed XML, without having to shoehorn additional, obvious steps around it)

"Our systems would grind to a halt trying to build and then deconstruct XML documents on each end!" I worried.

A few months later the project was implemented. It used XML. The agility that XML brought to both sides of the process offered convincing flexibility, and it was certainly the right choice for that project.

Perhaps I'm projecting, as us humans are prone to do, but I wonder how much of the XML-naysaying was motivated by a coworker or PHB who proposed XML as a cure-all for some corporate need, instantly creating XML opponents.

Of course I'm not trying to propose that all XML opponents are just trying to undermine a coworker: There are a lot of people with carefully thought out, well-supported arguments for their position, and who are opposed to XML being implemented where it would be a terrible decision. It's just that I think there's quite a few of the former sort as well, making me mildly suspicious when someone comes out, guns blazing, against XML.

For those on the fence I had considered authoring a detailed explanation of all of the strengths and weaknesses of XML, but there are already countless comparisons of that sort already out there (albeit usually being written to push an agenda that either XML is the silver-bullet of software development, or that it's a terrible mistake that needs to be corrected). Instead I'll simply end with a couple of simple points.

  • "XML" is a stack of related technologies. It is the leveraging of layers of this stack (such as the many brilliant, high-performance parsers and authoring tools, and the comprehensive XSD to document, communicate and validate concise, strongly-typed document formats) that presents the greatest benefit of XML.
  • . . .yet you don't have to use all XML technologies to use XML. You don't have to touch namespaces, or XSDs, or XQuery, or XPath or XSLT or ISO 8601:2001 or DTDs or any other XML-related technology to embrace XML. Really. Simply nesting a couple of elements, and intelligently choosing attributes, really is XML. Really. And it already takes advantage of the tremendous agility the document format offers. Too many XML beginners are turned into adversaries after being presented a seemingly endless array of acronyms and languages in the XML gamut, often with so little specific information that it's difficult to determine what holds value for a particular project and what's just adding noise to the process.

[This post authored in Word 2007]

Reader Comments

One of the reason why people detest XML is that for *their* problem, there is a better and simpler solution.

XML is so flexible that it can be -- and is -- used for a myriad purposes, from trasnferring data like in the case of your colleague, to constructing configuration files, to even being used as a database format. All this cases have a simpler alternative, but XML is the only concept which can cover all of them.

However, people forget that none of these uses are what XML was originally invented for -- it's main use, and one which I don't know a better alternative for, is to mark-up documents, defining which content represents what semantically.
Berislav Lopac @ 11/15/2006 1:20:30 AM
Entirely agree with you, Berislav, that XML gets misapplied frequently. No doubt about that (although configuration files happen to be a place where XML is often brilliant. Not just for the incredible easy of building solid, validated data entry screens -- in fact there are plenty of free tools that with a simple XSD can act as wonderful config tools -- but mostly for the development team agility, because it offers a flexibility that no other solution does...apart from some hacked, half-rate ripoff of XML).

>However, people forget that none of these uses are what XML was originally invented for

This may indeed be true, but it's also really largely irrelevant. That's akin to saying that Microwaves were originally built for RADAR, therefore they can't possibly be good for heating your dinner. We of course know that to be untrue, just as there are countless other, valid, justifiable uses for XML than just document markup.
Dennis Forbes @ 11/15/2006 8:41:39 AM
My point was that because XML was designed for a specific purpose, when it's used for other purposes -- all valid and justifiable -- there will naturally be better alternatives for these purposes.

I apologize if I made it sound as if I advocated use of XML only for marking up documents; it's just that in that use it hardly has better alternatives.

The XML-bashers somehow perceive that -- just because XML *can* be used for many other things -- it is somehow, by someone, advocated as the ideal solution for everything. So they react to that assertion, which actually exists only in their minds.
Berislav Lopac @ 11/15/2006 12:35:07 PM

Add Comment

Name *:

Email Address:

(your email address is not displayed)
Website:

Comment *:


Dennis Forbes - Dennis Forbes is a Toronto-based software architect and technology writer