Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Technically YAML is a superset of JSON. This means that, in theory at least, a YAML parser can understand JSON, but not necessarily the other way around. </p> <p>See the official specs, in the section entitled <a href="http://yaml.org/spec/1.2/spec.html#id2759572" rel="noreferrer">"YAML: Relation to JSON"</a>.</p> <p>In general, there are certain things I like about YAML that are not available in JSON. </p> <ul> <li>As <a href="https://stackoverflow.com/a/1726816/1218980">@jdupont pointed out</a>, YAML is visually easier to look at. In fact the <a href="http://yaml.org/" rel="noreferrer">YAML homepage</a> is itself valid YAML, yet it is easy for a human to read. </li> <li>YAML has the ability to reference other items within a YAML file using "anchors." Thus it can handle relational information as one might find in a MySQL database. </li> <li>YAML is more robust about embedding other serialization formats such as JSON or XML <em>within</em> a YAML file. </li> </ul> <p>In practice neither of these last two points will likely matter for things that you or I do, but in the long term, I think YAML will be a more robust and viable data serialization format. </p> <p>Right now, AJAX and other web technologies tend to use JSON. YAML is currently being used more for offline data processes. For example, it is included by default in the C-based OpenCV computer vision package, whereas JSON is not. </p> <p>You will find C libraries for both JSON and YAML. YAML's libraries tend to be newer, but I have had no trouble with them in the past. See for example <a href="http://code.google.com/p/yaml-cpp/" rel="noreferrer">Yaml-cpp</a>. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload