What type of application / use is YAML most suitable for?
It is difficult to answer unequivocally. Instead, I will try to give a few examples of the fact that YAML is not suitable (in my humble opinion).
<name type="string">Orion</name> <age type="integer">26</age>
This is an example of where it is useful to mix both attributes and values ββin XML. YAML has no attributes, so you need to use type inference to determine what date / integer / string / etc is - this is not possible for complex or user-defined types.
<user> .... 10 lines of stuff <sub-user> ...15 more lines of stuff </sub-user> .... 10 more lines of stuff belonging to user </user>
This is the case when closing tags in XML provide a big benefit. If you formatted the above data in YAML using only indentation to provide a βregionβ, it would be much harder to say where to start and end things.
For good measure, here is a quote from the official yaml specification on yaml.org
YAML is, above all, a data serialization language. XML was designed for backward compatibility with the standard generalized markup language (SGML) and, thus, it had many design restrictions that YAML did not share. Inheriting the legacy of SGML, XML is designed to support structured documentation, where YAML is more closely oriented to data structures and messaging. Where XML is a pioneer in many domains, YAML is the result of lessons learned from XML and other technologies.
Orion edwards
source share