Re:The havoc the XML purists wrought
by petercooper on Wednesday May 19, 2010 @09:42AM
(#1360896)
They say that XML is too complicated, but that's wrong. Just ignore everything but elements, attributes and namespaces. That's what RSS does, and it's very simple. [..] I don't trust would-be platform vendors who won't accomodate all possible developers, esp those who use a language that's so deeply installed as XML is.
He talks as if JSON is somehow "hard" for developers to grok. It's about as simple as you can get. I don't think it's noble to support a subset of XML, where regular JSON would fit better, merely to placate some developers used to doing things the hard way. If anything, API developers should be leading us by the nose to do things the best way.
Even if you "ignore" much of XML, as Winer suggests, you can still stumble into trouble. I've written (and used) a few RSS parsers in my time and dealing with broken XML with a regular XML parser is a gigantic pain in the ass. Many developers don't sanitize their input properly or dump source HTML or XHTML verbatim into their <description> elements. Try throwing that through Expat without thinking about it.. You can screw up JSON too, of course, but it's almost entirely down to quote marks alone.. not tagging, erroneous character encodings, non-existence namespaces, and more.
In contrast, Amazon supports XML in their web services, quietly and competently. I can't imagine them saying one day "It's too much work for us to keep supporting XML so you all have to rewrite your code now if you want to keep paying us for the web services you use."
Amazon's Web Services are good/unique enough for people to put up with the bullshit of XML in order to use it.. though their command line and Web interface tools are good enough that I suspect most users never need to get down to dealing with XML anyway.
Re:The havoc the XML purists wrought
by mattmillr on Wednesday May 19, 2010 @10:31AM
(#1361067)
There are plenty of complicated things that aren't complicated anymore if you ignore the complicated parts. (For example, the global financial system.) I don't think that line is a valid argument.
He talks as if JSON is somehow "hard" for developers to grok. It's about as simple as you can get. I don't think it's noble to support a subset of XML, where regular JSON would fit better, merely to placate some developers used to doing things the hard way. If anything, API developers should be leading us by the nose to do things the best way.
Even if you "ignore" much of XML, as Winer suggests, you can still stumble into trouble. I've written (and used) a few RSS parsers in my time and dealing with broken XML with a regular XML parser is a gigantic pain in the ass. Many developers don't sanitize their input properly or dump source HTML or XHTML verbatim into their <description> elements. Try throwing that through Expat without thinking about it.. You can screw up JSON too, of course, but it's almost entirely down to quote marks alone.. not tagging, erroneous character encodings, non-existence namespaces, and more.
In contrast, Amazon supports XML in their web services, quietly and competently. I can't imagine them saying one day "It's too much work for us to keep supporting XML so you all have to rewrite your code now if you want to keep paying us for the web services you use."
Amazon's Web Services are good/unique enough for people to put up with the bullshit of XML in order to use it.. though their command line and Web interface tools are good enough that I suspect most users never need to get down to dealing with XML anyway.