YAML compared to XML [closed]

YAML is much less verbose. The signal-to-noise ratio is higher without all the brackets. This makes it subjectively easier to read and edit for many people. On the flip side, it’s slightly (only slightly) harder to parse.

The biggest difference, though, is that XML is meant to be a markup language and YAML is really more of a data format. Representing simple, hierarchical data tends to be more gracefully done in YAML, but actual marked-up text is awkward to represent.

EDIT: I’d like to add, for reference, that YAML is essentially (though not historically) a “cleaner” version of JSON (“Javascript Object Notation”) that largely eliminates the latter’s perceived line noise (brackets and braces). If you can’t find a suitable YAML library for a particular project, then JSON is a more widely-supported alternative with many of YAML’s advantages.

Leave a Comment