Archive for the ‘SML’ Category

YAML and JSON

Tuesday, July 18th, 2006

In JSON on the Web, or: The Revenge of SML Simon talks about the growing use of JSON and YAML in competition to XML. Having used all three I have to say I like JSON a good deal more than YAML while XML is still useful. YAML actually really bugs me and I often stumble over its rigid formatting. I’d prefer Rails to use straight Ruby for it’s config files.

Simon says:

It also had the advantage of building right on an existing programming language, JavaScript, and could easily describe itself as JavaScript Object Notation (JSON).

Which is very true. It is lovely to use and requires no new concepts to learn.

Look at the JSON carefully!

It’s a subset of YAML, as it turns out. Well, not a perfect subset at first, but with the departure of JavaScript comments, it’s very close.

Technically yes but in practice not at all. YAML often trips me up when a text editor puts in a tab instead of a space or a value contains a colon or you have two blocks with the same name but different values. JSON just works nicely and you can format and align it pretty much anyway that suits your coding style.

I definitley see a good future for JSON but hope that YAML remains a config file language at most.