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?
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.
[This post authored in Word 2007]