4 ms·
Verbose, unwieldy, harder to read by humans (especially without syntax highlighting) in terms of picking out key data. More unwieldy to write in most languages
by twobyfour 9y ago
Verbose, unwieldy, harder to read by humans (especially without syntax highlighting) in terms of picking out key data. More unwieldy to write in most languages as well (most now have libraries that will convert a dictionary structure to [or from] JSON in a single call, while XML often still needs to be assembled element by element).
I think it would be an exaggeration to say that there's anything "wrong" with XML, but there's a reason JSON has by far overtaken it outside of "enterprise" applications.
That said, in some ways XML is preferable for standards - particularly in that there's a standard way to publish a document type specification, and widely available tools for validating a document against such specifications. The somewhat experimental equivalents for JSON haven't really ever caught on.
- quickthrower2 9y agoWith good tooling unwieldy and harder to read shouldn't be an issue for a transmission format. If you need to read a raw transmission you could have a tool that presents it a JSON. I find JSON hard to read though, so it's a personal thing. Verbose might be a real issue because it takes more bytes to send the same message. But then if you care about bytes, I think protobuf is worth considering instead of both JSON and XML.
- rurban 9y agoAlso slower and insecure. JSON is the defacto interop standard over the line.
- twobyfour 9y agoHow is JSON any more secure than XML? And no, XML is just as much a standard (in fact, a better defined one as a formal standard), and is still very much the default in most enterprise applications. JSON being more common in startup land doesn't make XML not a standard.