The great JSON vs XML debate

So Don thinks JSON is a great alternative to XML. That's pretty funny considering the crux of his argument is based on the premise that XML is bloated and this allegedly "fat free" alternative to XML isn't so slim and trim itself. In fact in most cases JSON encoded data is going to be about the same size as the same data encoded in XML.

Got the "same" message yet? Good. Because the whole "size" issue is pretty irrelevant when considered against a set of legitimate reasons why JSON is just not a good idea.

There are plenty of other reasons why forward-thinking developers ought not use JSON. The first and foremost would be that most of the world has already standardized on some form of XML. RSS. ATOM. RDF. SOAP. All these protocols are XML-based, not JSON-based.

The Top 3 Reasons Not To Use JSON

1. Not easily shared with other apps (interoperability)

No enterprise system or existing public API of note uses JSON. They use XML. That means that integration will once again become a pain in the proverbially behind if you use JSON. Using JSON as a data exchange format is about as wise as game developers who forced the use of IPX/SPX instead of TCP/IP for LAN gaming in the early days of MMORPGs. The lessons of the past should not be ignored.

2. Has to be be parsed, just like XML

There's no time savings here. JSON has to be parsed and interpreted, just like XML. So you aren't gaining anything by using JSON over XML and in fact I'd say that you're losing due to the interoperability issue.

3. No security

There's no security or well-known security measures available for JSON. Nothing that discusses the possibility of injecting malicious entities into the client-side code. Nothing. At least with XML we have some basic protection built into modern parsers against expansion attacks and size limitations. There's nothing for JSON because there are no real standards other than the ECMA standard upon which JSON is based.

Why are people reinventing the wheel? JSON has no significant advantages over XML, no promises of solving any of the issues that arise from the use of XML such as performance, and no support from industry leaders.

Now, when it comes down to it this is a personal issue, not a technological one. After all, BIG-IP doesn't really care whether you use JSON or XML, it handles both just fine. iRules is language agnostic, so you can manipulate and parse JSON or XML, as is your wont. The decision whether to use JSON or XML has to be based on the environment in which you are trying to integrate and the capabilities of other applications and services you may want to access. The reality is that most of those services and applications are either already using or moving steadily toward the use of XML. Not JSON.

And Don, we''ll talk later. I'm sure you'll see things my way after a short discussion. After all, all I have is a hammer. :-)

Imbibing: Coffee