For decades, software developers had to struggle with getting computers to talk to each other. Businesses developed systems to do different things at different times on different hardware, and integrating the data was rarely on peoples priority lists. Customers would tell the bank about changing their address and still get mail about their mortgage sent to an old address because the mortgage system had it’s own address file.
Then came XML. A standardised way of exchanging information, with formal standards for different types of application. For example: FIXML – Financial Information Exchange and BEERXML – Brewing information. There is a list here. There are about a thousand of them.
XML is human-readable and similar to well-know HTML so easy to use if a little long-winded.
Well, I am glad that is done and dusted. A major problem for IT systems has been solved. Then came another standard.
JSON is based on the JavaScript language. It is a highly formalised version of the way JavaScript stores data and is also used for data interchange. Why do we need another standard? Strictly speaking we don’t. I can’t think of a use for JSON where XML wouldn’t do the job instead. The reverse is not true, XML is more flexible than JSON with a richer set of options.
Search the web for JSON vs XML and you will see supposed advantages for one or the other. JSON often comes out well in these comparisons. But most of the advantages quoted are questionable. JSON files are smaller, but this is unlikely to be an issue. XML files are ‘harder’ to parse – sort of. But XML has been around so long there are libraries of routines to process files for any language.
JSON has one big advantage for one application. That is sending information from a web server api to a web browser. It is useful in this case because:
- It is much more compact, so the download is quicker.
- It will be processed by a JavaScript program and the processing will be much quicker.
- The coding is a bit simpler because JavaScript has native JSON functions
So it is kind of useful in this instance. But please no more.
Leave a comment