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.
To summarize, most of the critics address mostly design bugs, and a few inconveniences:
- It is insecure by default, allowing arbitrary code execution.
- Indentation makes it very hard to modify large files.
- Specs are really complex.
- Not always portable.
- ‘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:
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.
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.