JSON or XML

10:04 PM Aug 22nd 2006 from web under ,

JSON is a human readable lightweight data-interchange format, and is based on JavaScript, hence the acronym, JavaScript Object Notation. JSON is totally language independent, but its syntax is loosely based on the C family of languages, so integration with languages such as C, C++, C#, and Java are fairly straightforward.

XML is also human readable, and the most common form of transportation for SOA (service-oriented architecture) and data transfer. XML is completely platform and language independent.

The advantages to JSON over XML are as follows:

  • Common browsers parse JSON faster than XML.
  • JSON constructs can be loose interpretations of the server-side language being utilized, ie. Java.
  • JSON is stable and follows a strict methodology.

The advantages to XML over JSON are as follows:

  • Widely more adapted across all languages and platforms.
  • Calling existing services that use XML as a transport already exist, ie. XML-RPC, SOAP, WSDL
  • XML can be transformed on the fly with XSLT.

JSON libraries have been built for many of the common languages today, including, ActionScript, ColdFusion, Perl, Python, PHP, and the entire C family, including Java.

XML libraries have been built for most all languages. API’s include, XSLT, XPath, XQuery, and more. And you have a vast amount of open source projects in web development revolving around Ajax, Asynchronous JavaScript and XML, currently the biggest buzz word in the development community.

Future articles will reflect benchmark testing of these two data-transfer models, hopefully demystifying and questions I may have in regards to performance.

Reader Comment

Show all comments
  1. tom says:

    Is JSON really more readable than XML? With all those double quotes, users have to switch between braces and brackets… after a while it gets somewhat tiring…

Leave a Reply