JSON – XML with Anorexia?

Thanks to Jeff for pointing this out. Here is a 3 minute tutorial on JSON.

  1. They are both ‘self-describing’ meaning that values are named, and thus ‘human readable’
  2. Both are hierarchical. (i.e. You can have values within values.)
  3. Both can be parsed and used by lots of programming languages
  4. Both can be passed around using AJAX (i.e. httpWebRequest)

I have heard of JSON a while ago, when I was looking at Yahoo SDK for web. It looked cool but I did not spend time using it. I wanted to understand the following before I jump in:

  • Can it be used by languages other than Javascript – the answers seems to be yes.
  • Can I do a lossless transformation of XML to JSON and JSON to XML – I do not know but for the subset of XML it represents, this seems possible.

It is likely to be popular for AJAX apps. However, will it replace XML as payload? Only time will tell.