I recently notice that articles, blogs and tweets that denounce YAML as a viable format is on the rise. Introspecting, I feel I have the same feelings for a long time; and not only for YAML but also for JSON.

For starters, have a look at this and this.

To summarize, most of the critics address mostly design bugs, and a few inconveniences:

  1. It is insecure by default, allowing arbitrary code execution.
  2. Indentation makes it very hard to modify large files.
  3. Specs are really complex.
  4. Not always portable.
  5. ‘NO’ is not a valid key.

Amongst all, there are two problems that both JSON and YAML share in common which are sufficient for me to be a show-stopper:

  1. There is no built-in facility to help you show what the correct contents is: I mean something like what an XSD is for an XML file. Imagine editing a pom.xml file in Eclipse: You know which tag to insert by code completion. If pom.xml were instead pom.yaml or pom.json, I bet Maven would be dead by now, superseded by one or more of its many alternatives.

  2. In YAML, as the hierarchy gets more complex, it gets harder to impossible to guess how many spaces are needed to add a new attribute. In JSON, the same thing is true for curly and square braces. To my knowledge, there are no tools other than editor folding capabilities to aid you with that.

So, I believe XML is still way to go when it comes to user readability and writability, especially when it comes to application configuration.