>Don’t Blame XML for your bad habits

>There have been some comments from the modeling community picking on XML. XML should not be blamed for our own laziness, or bad habits. Use the right tool for the right job. The problem with XML is that in many cases it isn’t used correctly, or used in the place when it doesn’t need to be used. Sometimes a Java property file is much more efficient representation of configuration data than an XML file. Use the right tool for the right job.

I’ll argue that XML is much more human readable from a semantic stand point than some other representation formats that are really designed for machines, not humans. Comma Delimitted, EDI, or other formats that hide the semantics, or need a guideline to understand what particular data means at a certain position isn’t human readable. XML file formats can be horribly designed, but that isn’t XML fault, that is the designers fault.

Most notablly, tools that serialize Classes to XML files, are horrible from a human readable standpoint. If you see elements with the names of a A, CNT, SomeValueHere, the fault is in the serialization of the class to a XML representation. I agree that these files aren’t human readable. However elements and attributes named correctly can be very human readable, but then comes the other argument….XML isn’t machine friendly. It’s too robust. Again, it can be, but don’t blame XML for choosing to represent it or use it when it shouldn’t be used.

From a data exchange and markup standpoint, I’ll say that XML hits the correct balance between potential human readability, and machine processing. Having a common parser is not necessarily bad, if it fits the need. Why invent a parsing framework unless you absolutely have to?

Use the correct tool for the correct job. Modeling is a great thing, but a bad Model is going to have a bad representation no matter what format you choose. The fault lies in ourselves, not in any particular format.

Advertisements
This entry was posted in eclipse, xml. Bookmark the permalink.

4 Responses to >Don’t Blame XML for your bad habits

  1. SDiZ says:

    >On modeling — yes, 99.999% of the problem came from the designer. But XML do have its own set of problem: Legacy stuff such as CDATA / PDATA blocks; complex and nobody get it right feature such as namespace and DTDs. Compatibility such as HTML entities…. etc.XML is so verbose that it should never be touched with naked hand by newbies. However, as a text format, it’s a great temptation to write it in notepad ….

  2. David Carver says:

    >A valuable book on using XML effectively is Effective XML. A little education goes a long way.I agree, CDATA/PCDATA should be avoided where possible. However namespaces are misunderstood on what they are to be used and can be invaluable when building and combining XML related content.XML isn’t perfect, but most of the problems come from it being implemented wrong because people don’t take the time to understand how to implement it correctly. Don’t blame the format for our own laziness in learning how to implement it.

  3. Ed Merks says:

    >I only pick on XML because it needs to be knocked down a peg. The programmers of the world treat XML as a hammer and see every problem as a nail that needs to be pounded by it. Certainly XML is great for modeling because it’s a fully extensible markup language that can be used to serialize any model instance reflectively. I.e., modeling let’s every problem look like a nail and that makes XML a great hammer to bang it. But now we’d like to see a revival of a focus on notations designed with human readability as their primary driving force. We need to point out XML’s shortcomings in order to refocus. As you say, XML is a great tool in our repertoire, it just ought not be the only one.

  4. >XML might be human readable but it is not really human friendly when it comes to editing. One of the real annoyances of XML is that you cannot comment out attributes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s