Slashdot Mirror


Why XML Doesn't Suck

Richard Eriksson writes "Recalling the earlier discussion on why XML sucks for programmers, Tim Bray clarifies his stance on his co-creation, XML, and gets back on his pulpit to declare that XML Doesn't Suck. He writes: 'Let's look at some of XML's chief virtues, then I'll address some of the XML-sucks arguments, in the same spirit that Sammy Sosa addresses a fastball.'"

27 of 384 comments (clear)

  1. Sammy Sosa analogy maybe not the best by cant_get_a_good_nick · · Score: 5, Funny

    in the same spirit that Sammy Sosa addresses a fastball

    You mean he strikes out swinging on three pitches while trying to jack the ball in the stands instead of trying to make contact?

  2. Why XML doesn't suck ... by mustangdavis · · Score: 5, Funny

    .... because people will pay you out the ying-yang to convert their system to use XML ...


    ... enough said!


    Besides, it is a great buzz word!!!


    1. Re:Why XML doesn't suck ... by bwt · · Score: 4, Insightful

      XML is mostly just a buzzword, used by middle-managers in meetings

      Perhaps, but those meetings are about the fact that the department over there uses technology X and the department over here uses technology Y and the company saves $$$ if the two departments can actually talk because right now you pay people to do data entry twice and you pay more senior people to deal with the discrepancies.

      These managers ask their tech people "How do we deal with this problem" and they hear "XML" and take that up the chain.

      The bottom line is that in a company, system integration costs are the biggest expense in IT. XML decouples data from platforms and that makes integration easier and saves big bucks. So it becomes a buzzword because upper management needs buzzwords to describe things that enable.

  3. Hang on... by Quixote · · Score: 5, Funny

    Going from "XML sucks" to "XML doesn't suck" isn't clarifying your stance! It is doing a 360. Even Bill "I didn't have sex with that woman" Clinton would have a tough time with this one.

    1. Re:Hang on... by Anonymous Coward · · Score: 5, Informative

      Actually its doing a 180.

    2. Re:Hang on... by cant_get_a_good_nick · · Score: 5, Informative

      It is doing a 360

      Going around in circles yet ending up where you started? I think you mean 180.

      We're going to turn this team around 360 degrees.
      - Jason Kidd, upon his drafting to the Dallas Mavericks


      That sounds like the Mavs., going around in circles but never really going anywhere.
      - Me.

      Well, then anyway, they're not all that bad at the moment, best motion offense in the league.

    3. Re:Hang on... by saddino · · Score: 4, Insightful

      That would be "I didn't have sexual relations with that woman" A subtle distinction. ;-)

      And to stay on topic, XML sucks for some things and doesn't suck for others, just like any other technology. A hammer claw is a fine tool for removing a nail, but not as useful for removing a splinter from your finger. Less energy needs to be spent on arguing whether technologies like XML suck or not, and more energy needs to be put into studying their most practical and optimal uses.

    4. Re:Hang on... by HorrorIsland · · Score: 4, Funny
      Even Bill "I didn't have sex with that woman" Clinton would have a tough time with this one.

      "That depends on what the definition of 'sucks' is..."

      No, I can see him saying that.

  4. I DO hate XML by ruiner13 · · Score: 5, Interesting
    I have to write SOAP calls for our .NET website, and i'll be damned if XML isn't the most irritating language ever. It wouldn't be so bad if everyone could agree on syntax, but since XML is so vague of a language for every implementation there is a different syntax, even amongst the SOAP standard XML specs. I am currently working on hafing our website make a SOAP call to a PERL::Lite SOAP server, and can't get the .NET to get the right data out of the response, even though the Perl server understands the .NET request fine, and is sending the right response. If it was really the panacea for programmers, there would be no interoperability problems. Sure, a human can look at any XML schema and know what is going on, but computers are the ones who have to deal with it, and they seem to have problems frequently.

    Just my 2 cents.

    --

    today is spelling optional day.

    1. Re:I DO hate XML by EastCoastSurfer · · Score: 4, Informative

      It never ceases to amaze me how many people think XML is a language.

      LOL, so true. Maybe /. should link to a XML FAQ each time they do a story.

      XML document == data in a well defined format

      XSL/XSLT == tells how to display XML data(think FOP), but is itself a valid XML document

      XPATH == XML query language, which after you look a few examples it isn't too hard

      SVG == vector graphic format stored in an XML data stream

      XML itself is not hard, but until you figure out how all the many pieces fit together it can be confusing. Another thing to keep in mind is that you don't have to use every piece to make use of XML.

    2. Re:I DO hate XML by Mr.+McGibby · · Score: 4, Interesting

      You make a good point, but don't go far enough.

      I think the original poster's point was that XML allows for so much abiguousness, that every tool seems to do it differently and none of them can understand each other. The standard should be so strict as to *require* that if the same representation of a "piece of data" is made by two different tools, the representation should be exactly the same. No reason to say, "oh, you can put an endline there if you want, or you can end a tag these two different ways, whatever suits your fancy.

      Sure, the tools should have been written so that they all followed whatever standard is out there, but we all know that that doesn't happen. The standard should *force* the tool writer to be anal about the standard and follow all the conventions.

      A good compiler should do as good a job as possible to warn you of errors, before they become runtime errors (because those are harder to find). In the same way, a language should be designed such that more errors are compiler than run-time. In the same way, a standard should nearly impossible to create a file that doesn't follow the standard perfectly and still work. XML folks actually tout the opposite as a benefit!

      A tool is written and most of the time is tested with itself, and thus *seems* to work, but doesn't really.

      --
      Mad Software: Rantings on Developing So
  5. XML Confers Longevity by Spudnuts · · Score: 5, Interesting

    Mr. Bray makes a point about the longevity of XML based documents (where he says that tying up documents in a binary format is foolish), but this is a point that (La)TeX users have been arguing for years.

    Will XML really solve this problem? Hopefully the OpenOffice format will help, but if Microsoft maintains its marketshare (and keeps its XML generation limited or even proprietary), are we really better off?

    I'll just stick with LaTeX.

  6. basically why it doesn't suck by xagon7 · · Score: 4, Interesting

    I havn't read the article yet, but XML does NOT suck because:

    1. the data and/or fields added at anytime WITHOUT breaking anything

    2. the data is in a heiracherical format, reducing data replication and allowing for a more sophisticated data structure.

    3. the daya can be changed by a text editor.

    4. and BECAUSE the data is text, it compresses REALLY well.

    1. Re:basically why it doesn't suck by jandrese · · Score: 4, Insightful

      4 is a big old red herring.

      The data compresses so well because it's encoded in a highly inefficent manner. Your average compression algorithm will be able to find more redundancy and give you a better % compressed, but it still won't compare with a human actually packing the data tightly together in the first place.

      or, to take a more information theory POV, there is a certain amount of information in your post, which can be compressed down X percent by default. That same information has to be encoded in the XML version, and has the additional overhead of XML to deal with, so even compresed it will always be larger than the compacted and compresed binary only version.

      XML has a lot of strengths, but compactness is not one of them.

      --

      I read the internet for the articles.
  7. What's the big deal? by Telex4 · · Score: 4, Interesting

    I don't get all this fuss over XML. It seems to me that it's just a pretty handy markup language for programmers to use to store data in a human-readable (and therefore human-editable) fashion, that (with the help of things like libxml) also happens to be fairly machine readable. It's also extensible (X- duh!) and yet also has its limits.

    Why are there so many /. stories about this? Can somebody explain why this raises people's passions so? It seems to me like arguing the merits of HTML or SGML - it's all so bloody obvious!

  8. I agree, XML does not suck by dsoltesz · · Score: 5, Interesting

    As a web developer & admin, XML is my best friend. I have cases where I need non-webheads to develop content (better yet, portable content), and XML is the only way - they only have to know a basic set of HTML tags, they don't have to worry about HTML validation, formatting, or anything else, and everything they generate is consistent!

    Not ony can I transform their content into different views or formats, but (for example) the same XML file that is used to provide software documentation also is used to build the software GUI and provide tool tips and other forms of context sensitive help.

    No database required. No parsing required. Just a couple libraries and tools, and we're set to go.

  9. Re:XML is so good... by Randolpho · · Score: 4, Insightful
    The wild popularity of XML as a basis for application-level protocols such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple Object Access Protocol [SOAP], and Jabber [JABBER] prompted investigation into the possibility of extending the use of XML in the protocol stack. Using XML at both the transport and network layer in addition to the application layer would provide for an amazing amount of power and flexibility while removing dependencies on proprietary and hard-to-understand binary protocols. This protocol unification would also allow applications to use a single XML parser for all aspects of their operation, eliminating developer time spent figuring out the intricacies of each new protocol, and moving the hard work of parsing to the XML toolset. The use of XML also mitigates concerns over "network vs. host" byte ordering which is at the root of many network application bugs.
    This is an example of what XML is *not* good for.
    --
    "Times have not become more violent. They have just become more televised."
    -Marilyn Manson
  10. Try to stop seeing things in Black and White by MyTwoCentsWorth · · Score: 4, Insightful

    XML is much better that anything else in certain situations.

    XML is much worst that lots of other choices in certain situations.

    Why can't you see the shades of grey, and insist on seeing all in black and white ?

    Have fun,

    Daniel

  11. Code embedded in XML by CyberGarp · · Score: 5, Interesting

    I saw a letter to Dr. Dobbs recently that was saying that XML needed to have the ability to embed things like Visual Basic and javascript in it to be really useful. I think that this is a horrible idea. The whole point of XML was to have a generic data model, i.e. one parser to rule them all.

    I've been able to do thing like export MySQL schemas into XML, then using XSLT generate an entire set of base classes providing persistent objects. What was once weeks worth of work, now takes an afternoon (from concept to final product). The whole set is entirely consistent, no misspelled names or changed signatures. When bugs were found, I fixed all the files in one place and rerun the XML/XSLT script. Massive productivity boost. If that isn't an argument on why XML doesn't suck I don't know what is.

    The idea of embedding code in XML is a perverse distortion of what XML is really about. XML would suck if one uses it for unintended purposes. I don't use a hammer to tighten machine bolts, well I guess some people do.

    --

    I used to wonder what was so holy about a silent night, now I have a child.
  12. Tim Bray's Original Post Was Off Base by Carnage4Life · · Score: 4, Informative

    The main thesis of Tim Bray's original post was that he didn't like having to choose between either storing all his data in memory (i.e. DOM) or using a callbacks(i.e. SAX) when processing XML. The problem with this kind of thinking is that although it may have been true two or three years ago that the only way to process XML was via DOM or SAX this is no longer the case.

    There are more classes of APIs supported on multiple platforms for processing XML such as pull-based APIs and cursor based APIs which are represented by the System.Xml.XmlReader and System.Xml.XPath.XPathNavigator in the .NET Framework. Similar APIs exist in the Java world as well as Python from what I've heard. This is besides the current push in some quarters for programming languages that natively process XML (i.e. intrinsicly understand an XML datamodel or datatype).

    Tim Bray's original problem was that he doesn't have a pull-based API for XML parsing in Perl. I pointed out in my kuro5hin diary how the pseudo code he showed as being his ideal for processing XML already exists in C# and .NET Framework. This article on XML.com points to other people who also point out that such pull-based APIs for processing XML are available on other platforms and languages as well.

  13. XML as dough by WetCat · · Score: 4, Insightful

    People who say XML sucks are the people who are forced to look at it and change it by hand.
    But XML is not for that!
    XML is like dough. Nobody eats raw dough (it's probably OK to eat it, but it ISN'T tasty), but eats cookies and bread instead.

    XML is NOT for user and/or administrator usual exposure, XML is for application data transfer.
    And applications that require XML to be written by human are only half done: they should be used in combination with HumanInput -> XML generation programs.

  14. Some people just don't "get" XML by binaryDigit · · Score: 4, Insightful

    You read some of the arguments against XML, and you realize that people just don't "get it".

    1 - XML sucks as a language

    Repeat after me, XML is NOT a language. Certainly not in the sense that C++ is a language. XML is a standard that defines how one structures data.

    2 - XML is bloated, I can send binary much cheaper/easier

    DUH. If your application is fine using binary data transfer, then USE it. HOWEVER, many applications that either have to A) communicate with other applications or B) have to deal with varying data sets benefit greatly from using XML. Anyone who has been programming for any length of time knows that while binary is more compact, it is less flexible and potentially more error prone. Want to add a new field in the middle of your data, boy you better not get your software versions mixed. Want to write an app that can do reasonably intelligent things with ANY data it recieves, binary is not the way to go. As with all things in life, use the tool for that which it was intended (vs some peoples view that it is the end all be all of data representation).

    3 - It's slow

    Same as 2 above. If absolute performance is an issue, then by all means, use whatever representation gives you what you need. XML is about flexibility and standardization, NOT performance.

    4 - It's complex

    Well as complex as you want to make it, and it does sometimes encourages more complexity than is really needed, but it doesn't FORCE you into it. If you want/need schemas, go for it. If you need the functionality but in a simpler form, then do that (unless of course you need to communicate with another system expecting a schema, but his is obvious). It's just like C++, you don't HAVE to use templates and multiple inheritence (hell, you don't even have to create classes if you don't want/need), you use the parts of the tool that are useful and provide benefit, you don't use them just because they're there.

    So I don't see what all the bruhaha is about. It has it's strengths, it has it's weaknesses. As with anything, relatively, new, people are trying it in various places. Some of these places not really fit, others do. I've designed apps that benefited greatly, others I've dismissed xml for entirely.

  15. Electronic Data Interchange (EDI) by Anonymous Coward · · Score: 4, Interesting

    I work for a VAN (Value Added Network) which is basically a middleman for data. You send an electronic purchase order to us; the company you're ordering from gets it from us. The value we add is we'll say you sent and tell you they got it.

    However, we charge by the kilocharacter of data you send and receive per month. So, for us, XML is awesome, because it increases the size of an ASCII-X12 or EDIFACT document by a factor of 5-a lot more (usually somewhere around 15-20 I think).

    X12 and EDIFACT are standards for business document exchange that have been around for a while, but people are converting to XML because they think it's better (eventhough, usually, they just use the X12 or EDIFACT format, but with XML tags).

    For example, a line item record may go from something like this:

    LIN:0001

    to something like this:

    <LIN_GROUP>
    <LIN>
    <LIN_01>0001</LIN_01>
    </LIN>
    </LIN_GROUP>

    It's not always that bad, but it can also be much worse. (Imagine replacing each instance of "LIN" above with "Line_Item" and "LIN_01" with "Line_Item_Number".) (And why won't that semi-colon after the LIN_01 end tag go away?)

    so-- for us, XML doesn't suck-- it increases our revenue. For our clients, it's sucks, because it increases their monthly bill.

  16. Re:nuts! by CynicTheHedgehog · · Score: 4, Informative
    It's not XML's fault that Microsoft isn't implementing it.


    Are you smoking crack? I hate Microsoft as much as the next guy, but have you seen .NET? Holy cow. Everything having to do with data sets has been XML-ized, from query results to transactions to SOAP...you can't swing a dead cat without writing a schema first. Look at SQL Server 2000...everything can be done in XML. And then ASP.NET is XML-based (using the convention), and lets not forget the .NET app web.config file, which is XML.

    Granted, MS hasn't backported everything to XML (think we'll ever see an XML registry?) but everything going forward has XML tattooed all over it. I happen to love XML, but if anything Microsoft tends toward the zealous side.
  17. Re:nuts! by Kombat · · Score: 4, Informative
    XML is very useful. It's not XML's fault that Microsoft isn't implementing it.

    Ppppppht! *sprays water all over monitor* Microsoft's not "implementing it?" What in the heck do you mean by that? Have you taken a look at anything in the .NET suite lately? The entire system is built on XML. The solution files, project files, assembly manifests, application configuration files, setup binding files - they're all XML! Visual Studio .NET is build extensively on XML, and the .NET API includes some very intuitive and powerful classes for reading, manipulating, and building XML documents. I suggest you do at least a cursory investigation before spouting something so outrageously inaccurate next time.

    --
    Like woodworking? Build your own picture frames.
  18. Re:nuts! by MeanMF · · Score: 4, Funny

    if you were trying to convey the fact that MS has embraced and extended the fsck out of XML, thus totally destroying it and not properly implementing it, then yes, I would agree...

    Micro$oft sure has some balls extending the "eXtensible Markup Language"...

  19. XML is Verbose...compresses beautifully-- NOT!! by coats · · Score: 4, Informative
    I'm an environmental modeler (think supercomputing) , and most of the time the stuff I generate won't fit into dinky little 2GB files. Model data doesn't compress well (and even if it did, it'd take too many tera-ops). And then, forcing it into a sequential access model is not a good idea.. When you have a 10GB data set, you really need direct access to mine the contents, rather than having to "eat the file whole."

    But bureaucrats being what they are (and bureaucrats being in charge of environmental agencies), they've been told that XML is a GOOD THING, and want to force everything into that mold. And it doesn't fit!

    Call it the "law of the instrument," as someone (Poul Anderson, I think, put it:

    As soon as you invent a new and better type of monkey wrench, you can be sure someone will make use of it -- as a bludgeon!
    That's XML, to a tee!

    --
    "My opinions are my own, and I've got *lots* of them!"