[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] use of JSON instead of XML
- From: Gareth Oakes <goakes@gpsl.co>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Mon, 25 Jun 2018 22:41:10 +0000
I'm normally quite good at holding back from JSON vs XML discussions, but a recent project has made one point quite clear to me. JSON is often selected pragmatically, my reasoning is presented below.
> On 25/06/18 06:17, Mukul Gandhi wrote:[...]
> > 2) Architects have been choosing JSON in general, instead of XML as a
> > data exchange syntax. Perhaps this is because, JSON is simple to use
> > instead of XML.
>
> This is a popular fallacy, exposed many times, most recently by Debbie
> Lapeyre in her closing keynote at the MarkupUK Conference in London a
> few weeks ago.
Firstly, I'm not convinced it is a fallacy (that Architects are choosing JSON over XML). I believe XML is a dirty word in many circles and architects will choose JSON or YAML or something else when it suits. When the data model is mismatched, e.g. narrative data vs row-by-column data, it is often a case of horses-for-courses. XML or HTML are a good choice for narrative data. I can only think of a few examples of serious systems where JSON is used for narrative data (e.g. eLife Lens).
On to my actual point. One sound reason that JSON is selected is pragmatism. JSON is a Javascript-native format that you can easily use within Javascript, with few surprises and little training. Javascript is the language of choice for so many client and server side systems and applications these days. Unfortunately the E4X initiative, which seemed so promising in its early days, ended up being a complete mess as it didn't support XML properly.
I'm certain others on this list will quote a variety of useful Github libraries, npm packages, or jQuery/ExtJS/etc. framework methods that help with XML; my point is that these are considered ways of *dealing with* XML. XML is not at the heart of the Javascript language as a first-class citizen (unlike the XSLT language). I feel that something like E4X was the right approach, but a poor technical design and implementation.
In summary; I'm not sure what the overall point of my argument is, if it even is an argument :) I feel that, given the primacy of Javascript, most of the time JSON is the safe choice because it is easy to work with given developers' existing toolsets and training.
// Gareth Oakes
// Chief Architect, GPSL
// www.gpsl.co
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]