JSON is so hot right now. It's a superior alternative to XML for many reasons:
- It's shorter, since there's no need for end tags, etc.
- There's no futzing about with namespaces.
- It's not based on SGML, the ugliest, hardest to type language in the universe.
And so forth. It's practically the second coming.
But it's not without its shortcomings...
- JSON doesn't support comments, so is pretty much a write-off for any sort of configuration file. Just bloody skip them! (Some parsers do this anyway.)
- JSON doesn't let you write an extra comma to separate array/object items. In Python, this is perfectly acceptable, and for at least one excellent reason: it's simpler for machines to generate. Otherwise, you end up with an inevitable "if this is not the last element, write a trailing comma" in all your for loops. Gross.
(To be continued...)