by utnick · 18y ago · 0 comments
If I have some data structures that I am trying to send from my C# windows app to your java unix app, how would you propose we do that?
With XML, we can easily agree and collaborate on a format and both of our languages have builtin libraries to extract the data we need.
Its easy to build and easy to debug.
Note also that there are other technologies with pervasively available parsers, like JSON, which don't share any of XML's warts.
Now how do you propose we do that?
This is entirely the problem. The XML didn't solve anything. We still have to negotiate the terms of the transfer. We've agreed to use XML, true, but we are still at square one.
The xml solved the problem of me having to write a parser from scratch for whatever terms of transfer you come up with.
And I don't really see the downside for most applications.
S-expressions solved this problem a long time ago. (a b c) is only 57% markup. I don't think you can get much more succinct than that and still express the idea of a list.
If message size is an issue then gzip the data. Or if you have very specific needs for processing speed, look into something like Googles protocol buffers.
You are optimizing at the wrong level if you are concerned about a few extra characters in a human-readable data exchange format.
What matters is: a list of what. Telling me (5, 7,11) means nothing.
<sizes dress='5' pants='7' shoes='11' />
is what's of value.Would an sexp be terser? Sure. But not enough to matter.
If I am sending some big list many times and speed really matters, then I care, but usually I am not. Size and speed are cheap nowadays.
You replied: OK, I'm going to send you a list using XML.
The only thing you have proved here is that your blind hatred for XML makes you unable to read and parse what is posted.
When arguing against the evils of a standardised format which there are proper parsers for everywhere, failing to parse stuff yourself is probably not on the list of things you want to do.
Plus, given that the availability of good XML parsers is one of the primary advantages claimed for XML, can anyone name some XML parsers that aren't ridiculously slow? Maybe I haven't looked hard enough, but I always seem to find that my own code to parse ad-hoc formats goes 10x faster than, e.g., expat parsing XML.
No I didn't. Because that's exactly what the guy in the OP said. Agree on a XML schema for the data. After you've done that, writing some simple Xpath to get your data is done in minutes.
The only times my XML code is 100% DOM is when I need to make things from scratch or do XML data manipulation.