4 ms·
Nonsense. They look very different, and that matters, at the very least. In particular I like that JSON has some sense of "type" built into the format, when you
by javajosh 11y ago
Nonsense. They look very different, and that matters, at the very least. In particular I like that JSON has some sense of "type" built into the format, when you omit quotes you know it's a number or a boolean. You can get that (and better than that, really) with XML Schema (or old-school DTDs) but it's baked into JSON. Plus, dealing with JSON in a JavaScript interpreter is about as simple as it gets; only if you're programming in XML (e.g. with Ant) would you ever say the same about XML. It's quite nice to be able to "dig in" to JSON using normal, plain-vanilla JavaScript dereferencing tools and looping constructs.
As for the tooling around XML, that's okay, but it's almost always overkill, and it almost always turns out the overhead of the tooling becomes a problem in-and-of-itself.
Anyway, JSON is actually a better data format.
- usrusr 11y agoI think your point could have been made even better if instead of quotes/numbers/strings you would have illustrated the in-band typing using square brackets and arity. Two bytes for "there can be more", so much better than the plural/singular convention often seen in XML (rarely without some creative breaches closely nearby). In hindsight, the biggest advantage of XML over JSON was that it was painful enough to make schemas popular, a quality JSON is lacking. Unlike schema languages, which do exist. To me, XML tooling lost quite a bit of its appeal when I realized that all the typing available via the various schema languages is completely lost to the world of xsl/xpath/xquery. I understand the reasons for that, but that does not provide much consolation.