From: Vladimir G. <vla...@du...> - 2011-06-16 16:34:16
|
On Jun 16, 2011, at 4:03 AM, Roderic Page wrote: > +1 for JSON > > JSON is clearly the way to go for moving data around on the web. XML > has some advantages for writing structured documents, so I see a > place for NeXML, but OMG can it be verbose. If you want broader > developer engagement, JSON is great (but please, please not some > hideous XML -> JSON conversion) [This is sidetracking the main thread, but as someone who had a bit to do with XML in the past, I must try re-route part of XML frustrations towards the real problem. ] XML and JSON are pretty much isomorphic in what they can represent. The *innate* difference in verbosity is very slight: where JSON says "foo" : { .... } XML says <foo> ... </ foo> (1) Yes, XML uses a few more characters, but not that many more! I'd claim that 80% of the perceived OMG-verboseness of XML comes from the way people design their XML formats, which, unfortunately, is strongly influenced by the multitude of cruft specs around XML (namespaces, Schema, ...). In other words, the way you can screw up your format in XML, you can screw it up in JSON, too. And conversely, if you can manage to create a clean format with JSON, you can mimic it in XML, with minimal overhead in verbosity, exactly as in (1). Some would even call it readability! This remark is not to protest using JSON in place of XML. (After all, I admit, it should be more difficult to screw up with JSON.) This is just a word of caution not to overlook real design problems that might be behind the drive towards JSON as a new magic hammer. These problems would not solve themselves magically. I do not know what they may be in the NeXML case, but a generic (aka hideous) XML -> JSON conversion might actually expose them to JSON aficionados! --Vladimir |