One thing that comes to mind is (for data interchange), it allows for custom objects to be explicitly marked as such
http://www.yaml.org/spec/1.2/spec.html#id2805712
additionally, it allows multiple top level objects in one file (which JSON can't do (not counting 3rd party modifications))
other than that, not much other use
Re:JSON vs. YAML – try it yourself
by Ded7xSEoPKYNsDd on Tuesday April 07, 2015 @06:27AM
(#9332946)
> additionally, it allows multiple top level objects in one file (which JSON can't do (not counting 3rd party modifications))
That's just different syntax for a top-level list of objects.
I hadn't thought about comments - that is a clear advantage to YAML. Great point to bring up, and supports the popular view I'm seeing that YAML is maybe better for config files. I can think of numerous scenarios where a configuration decision could use some context.
Re:JSON vs. YAML – try it yourself
by oneeyedpigeon on Tuesday April 07, 2015 @03:00AM
(#9332374)
For some use cases - and configuration is a prime example - it can make sense to add the comment directly to the data, as another property of the relevant object. that then allows you to use the comment e.g. in a front-end config editor.
For data interchange, I don't see a lot of advantages to yaml though.