The Hidiocy of XML Languages 37

Posted by Uncle Bob Fri, 18 May 2007 03:01:22 GMT

I’ve been reading up on some of the newer aspects of SOA, and came across BPEL. It’s another language you are supposed to write in XML. Get ready for a rant.

I’ve had it. What is the matter with these people? How, after all the experience we’ve had with XSLT, Ant, WSDL, etc., etc., could they create YET ANOTHER XML language. Are they dolts? Are they idiots? What gives.

Look, writing in XML is hideous. It’s wordy, it’s error-prone, it’s arcane, it’s redundant, it’s redundant, it’s redundant, it’s… HIDEOUS! To make matters worse, we have been embedding OTHER languages INSIDE this horrible container. EGAD! YIKES! ZOUNDS! FORSOOTH! This is just plain nuts, stupid, idiotic, retarded, poo-poo-headed, silliness!

Haven’t these people heard of economy of expression? Haven’t they heard of YACC? Don’t they know that domain specific languages SHOULD BE LANGUAGES? Don’t they know that languages have specific GRAMMARS?

Besides, have they ever tried to write an interpreter or compiler that uses XML as it’s source? It’s not any easier than writing a YACC parser! Indeed, it’s a lot, lot, harder.

EMBEDDING THE GRAMMAR OF YOUR DSL IN XML IS STUPID!!! DON’T DO IT!!!!!#$#$!!!

I hereby declare a revolt. From now on anyone who considers themselves to be a serious professional must refuse to write another line of XML. When asked, say NO. Instead, write a little YACC grammar that is nice, and small, and translates into that hideous XML. You’ll save yourself GOBS of time if you do! What’s more, if you sell your parser for $5 per download, you’ll probably be able to buy a new boat! Maybe a fleet!

Comments

Leave a response

  1. Avatar
    Bob Corrick 6 days later:

    found your new home via Brad Appleton -> butunclebob

    I wholeheartedly agree. Just ordered a book on ANTLR, to dip my toe in that water.

    regards Bob Corrick Developer

  2. Avatar
    Dean Wampler 11 days later:

    I have this nutty idea that “scripting languages”, like Groovy, Ruby, etc. will largely supplant XML for everything non-trivial. So, you might still use XML for data, but you’ll use a mini-DSL in Ruby to express your business processes, etc.

  3. Avatar
    Debasish Ghosh 13 days later:

    How about s-exp instead of XML as program and data. I had blogged about this some time back (http://debasishg.blogspot.com/2007/05/xml-not-for-human-consumption.html).

  4. Avatar
    Bill de hOra 14 days later:

    At the top of your page:

    html xmlns=”http://www.w3.org/1999/xhtml”

    So yes; please stop writing in XML.

  5. Avatar
    Andrei Pamula 14 days later:

    ... or define a DSL in ruby, making use of real objects, make it user-friendly (ruby already is pretty :D). Now you can use any ruby editor in order to write specifications in your DSL.

    Did I mention that you can now unit-test your DSL?

  6. Avatar
    DAR 20 days later:

    Ummm … has it ever occurred to anyone that there’s actually good reasons for writing file formats and protocols using XML??

    First off, yes XML-based files/protocol streams need to be readable by humans, but only incidentally so. They’re primarily for communication between computers. Yes, occasionally people need to read them for debugging purposes and such, but that’s a secondary need. Given that, if the format is reasonably readable (i.e., text-based), that really is sufficient.

    Secondly – and most importantly – the single, paramount, important reason why people base new things on XML is so that they can take advantage of standard tools to read/write these things. Why on earth should someone have to painstakingly craft a new grammar file from scratch (including minute details like what characters are allowable and where, how escaping will work, etc.) every time they need to create a new file format or protocol?? It makes zero sense. (Or, as you would put it, “This is just plain nuts, stupid, idiotic, retarded, poo-poo-headed, silliness!”) Surely leading members of the agile community can see the benefit of NOT REINVENTING THE WHEEL … several different times … on every project??!?

    Third, you’re completely overlooking one incredibly important benefit of XML: XSLT. XML-based formats gain the huge benefit of having a preexisting analysis and transformation language available for it – completely for free! Want to analyze or filter your file or protocol stream? Easy! Just whip up a quick XSL file to do so. Want to transform your file or protocol stream into any other file format on earth? Again, piece of cake.

    Helllllllooooooo wheel reinventors! Please paste this on your screen: “XML has a lot of benefits and will save me lots of time. It is not evil!”

  7. Avatar
    Andy Glew 29 days later:

    Yes, humans should never write directly in XML.

    However, I agree with DAR: the advantage of XML is that standardized tools can manipulate it. I’ve written a lot of program analysis tools that have had to deal with the idiosyncrasies of C/C+, Perl, etc. – tools that are examining programs written in those languages. Or, rather, I’ve created klugey and fragile hacks – because it is pretty damned hard to find parsers for C/C+, or Perl, if you are not actually in a compiler team.

    Consider SWIG, the interface and wrapper generator: it has to parse your C/C++ code. Started in 1996, even after 10 years it does not handle all of C++.

    Obviously a compiler has to parse the language it is compiling. Tools like SWIG need to, as well. Obviously there should be a library that encapsulates the parsing, that can be shared between such tools, to avoid people having to write the parser again and again and again in different ways.

    The best effort I have seen in this is GCC/XML. Its C/C++ parser is moe likely able to parse the whole language because it is the GCC parser. Unfortunately, it is forked and back versioned – so it does not support language features whose support was fixed or extended in later versions of GCC.

    But anyway, my points are:

    a) Parsing languages like C/C++ and Perl is hard.

    b) Some tools need to do so.

    c) If these languages can be translated to XML, it makes such tools easier.

    OK, so that only means that I want a text-to-xml translator for languages such as C/C++.

    But I can forsee the day when the language itself is defined in terms of XML. Humans would not write the XML, only tools and editors would…

    Not only would such languages be easier to write tools for.

    But such languages would also be easier to extend. E.g. consider that C and C++ diverged, in large part because many legal C programs are illegal C++ programs because C++ defined keywords that were legal C variable names. And nw the same thing is happening again, as C++ tries to add new keywords such as atomic, that used to be legal identifier names.

    Any language that has a small set of keywords that would otherwise be legal identifiers is hard to extend.

    Or, consider, C++ templates: which do you prefer, saying “typename Traits::int_type” all over the place? If you write lots of template could, it gets well nigh unreadable. But if it were – well, that is even more unreadable. But if your IDE hides the XML stuff, and just says “Traits::int_type” in some nice font and color?

    XML languages suck.

    But I expect there will be a new genheration of languages that do not look like XML, but which use underlying XML to distinguish keywords, types identifiers – to indicate language elements.

    And I look forward to the program comprehension tools that such languages will facilitate.

    In the meantime, I am looking for better tools such as GCC/XML.

  8. Avatar
    Terence Parr about 1 month later:

    Hi. You might enjoy my article called Humans should not have to grok XML.

    Regards,
    Terence

  9. Avatar
    Tim about 1 year later:

    Uncle Bob: thank you. Please keep saying this loudly and often

  10. Avatar
    Regim Hotelier Bucuresti over 3 years later:

    So, I am starting up a new project, and wanted to have a more visible indicator of what my Continuous Integration builds were doing. I am sticking with CruiseControl for this project, even though I recently looked at Continuum, and must say that it is really nice. I probably will start using that …

  11. Avatar
    Pandora over 4 years later:

    I don’t recommend that on any project that needs to work, but I also don’t recommend using a real product to learn your tools.

  12. Avatar
    iPhone contacts Backup over 4 years later:

    When I come to here, I think I am in the right place. the web gives me a lot of infomation, it is very informative. I think lots of people can learn much here. I will come to here again. Thanks.

  13. Avatar
    pandora over 4 years later:

    An important feature about buying on the web is you get to observe something the actual presents, where in a store it is usually tough to form on the other hand his / her inventory to discover the right thing. Mums adore items that are unique. Attempt to found your mother utilizing a gift that’s personalized, just as one representation a wedding ring applying their name engraved within it. Gold wedding rings make for fantastic items simply because they immortalize the mom?¡¥s identify in precious metal. A new rare metal necklace along with a necklace produces a amazing presents for the mommy, as well as gifts that happen to be generally overlooked

  14. Avatar
    Silicone Molding over 4 years later:

    Mold making is the core business of Intertech (Taiwan). With world level technology, Intertech enjoys a very good reputation for making Injection Mold and Plastic Moldsfor their worldwide customers.

  15. Avatar
    Tenant Screening over 4 years later:

    From now on anyone who considers themselves to be a serious professional must refuse to write another line of XML. When asked, say NO. Instead, write a little YACC grammar that is nice, and small, and translates into that hideous XML.

  16. Avatar
    Criminal Records over 4 years later:

    The best effort I have seen in this is GCC/XML. Its C/C++ parser is moe likely able to parse the whole language because it is the GCC parser. Unfortunately, it is forked and back versioned – so it does not support language features whose support was fixed or extended in later versions of GCC.

  17. Avatar
    Sunglass over 4 years later:

    Women Replica Sunglass at cheap discount price

  18. Avatar
    SEO Firm India over 4 years later:

    Excellently written article, if only all blogger offered the same content as you, the internet would be a much better place. Please keep it up!

  19. Avatar
    jaychouchou over 4 years later:

    To be, or not to be- that is a question.Whether ipad bag tis nobler in the mind to suffer The slings and Game Controllers arrows of outrageous fortune Or to take arms against a sea of troubles, And USB Gadgets by opposing end them.44444444

  20. Avatar
    okey oyunu oyna over 4 years later:

    nice article.

    Okey oynamak hiç bu kadar zevkli olmadi. Online ve 3 boyutlu okey oyunu oyna ve turnuvalara sende katil.

  21. Avatar
    funny pictures over 4 years later:

    “Okey oynamak hiç bu kadar zevkli olmadi. Online ve 3 boyutlu okey oyunu oyna ve turnuvalara sende katil.”

    R u sure ?

  22. Avatar
    christian louboutin shoes on sale over 4 years later:

    Have the christian louboutin patent leather pumps is a happy thing. Here have the most complete kinds of christian louboutin leather platform pumps.

  23. Avatar
    Jewellery over 4 years later:

    Online UK costume and fashion jewellery shop with,

  24. Avatar
    Crystal Jewellery over 4 years later:

    Great post! Nice and informative, I really enjoyed reading it and will certainly share this post with my friends . Learn everything about what is cubic zirconia

  25. Avatar
    beats by dre store over 4 years later:

    I really enjoyed reading it and will certainly share this post

  26. Avatar
    beats by dre store over 4 years later:

    beats by dre sale cheap beats by dreenjoyed reading it and will certainly share this post

  27. Avatar
    bagsupplyer over 4 years later:

    Good Luck!It is nice of you to post it. Discount designer Men Evisu short pants from China at on line store

  28. Avatar
    DR OZ african Mango over 4 years later:

    It is not hard to understand why the question of value is still raised when you consider that today?s outsourcing models have some inherent limitations that reduce the overall gains companies can achieve .

  29. Avatar
    shanewatson404@gmail.com over 4 years later:

    I am very Mechanical Engineering Job Description much happy for providing the Chief Executive Officer Job Description amazing technology is visible in this log Desktop Support Job Description This is very much satisfied by the Police Officer Job Description great services in this website and using the great services in this blog

  30. Avatar
    canada goose coat over 4 years later:

    When it comes to feather dress, what appears in your mind? Which kind brand of down jacket do you like prefer? Though there are many down jackets for you to choose from, on the word, which one you really enjoy? I want to say that canada goose coats is really your best choice. I believe you can’t agree with me any more. When you take the quality into consideration, you will find that it is superior to any other kind of coat. Besides, discount canada goose jackets is a world well-known brand, which has gained high reputation in the world, which has accepted by our customers and some organization. Because of its high quality, some of our loyal customers have promoted it to the people around them. In their opinion, it is good to informing others to know it. Recently, Canada Goose Trillium Parka is on hot sale. What I have to inform you is that all the products there are made by hand, so they are elaborative and elegant enough. It is really beautiful once you dress in. So, if you are a lovely girl or woman, go to the store to buy one for you. You will appreciate it that you have such a coat.In addition, they also have any other products like canada goose Gloves and canada goose jacket supplier.Hope your will like its!

  31. Avatar
    Tips For Bowling over 4 years later:

    It would appear that the number of nonsense triplets is rather low, since we only occasionally come across them. However this conclusion is less secure than our other deductions about the general nature of the genetic code.

  32. Avatar
    Alex smith real estate over 4 years later:

    I am very much enjoyed for this info in this blog that to really approach for the nice technology is visible in this blog. This is really surprised for this info in this blog that to sharing the nice info in those guys in this blog. This info is really enjoyed for this info in this blog. Thanks a lot for sharing the nice info in this blog that to very much satisfied by the technology in this blog.

  33. Avatar
    christian louboutin over 4 years later:

    The professional design make you foot more comfortable. Even more tantalizing,this pattern make your legs look as long as you can,it will make you looked more attractive.Moveover,it has reasonable price.If you are a popular woman,do not miss it.

    Technical details of Christian Louboutin Velours Scrunch Suede Boots Coffee:

    Color: Coffee
    Material: Suede
    4(100mm) heel
    Signature red sole x

    Fashion, delicate, luxurious Christian louboutins shoes on sale, one of its series is Christian Louboutin Tall Boots, is urbanism collocation. This Christian louboutins shoes design makes people new and refreshing. Red soles shoes is personality, your charm will be wonderful performance.

  34. Avatar
    beats by dr dre over 4 years later:

    A university studentbeats by dr dre caught by the enemy, the enemy tied him at the poles,just beats solo headphones purple and then asked him: say, where are you? You do not say it electrocuted! Scheap dr.dre beats studio headphones balck/yellowtudents back to the enemy a word, the result was electrocuted, he said: I am TVU.Hot sale beats by dr dre pro headphones

  35. Avatar
    iphone sms to mac backup over 5 years later:

    Most of us will delete the SMS file if the iPhone inbox is full. For some of the very important text file, you would like to save it to Mac hard drive and read it later or you need print them. So, why not export the text message to HDD and save it now?

  36. Avatar
    louboutin sales over 5 years later:

    The Hidiocy of XML Languages 35 hoo,good article!!I like the post!23

  37. Avatar
    bladeless fans over 5 years later:

    The Hidiocy of XML Languages 36 good post165

Comments