Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Differences:</p> <ol> <li>YAML, depending on how you use it, can be more readable than JSON</li> <li>JSON is often <a href="https://stackoverflow.com/questions/2451732/how-is-it-that-json-serialization-is-so-much-faster-than-yaml-serialization-in-p">faster</a> and is probably still interoperable with more systems</li> <li>It's possible to write a "good enough" JSON parser very quickly</li> <li>Duplicate keys, which are <em>potentially</em> valid JSON, are <em>definitely</em> invalid YAML.</li> <li>YAML has a ton of features, including comments and relational anchors. YAML syntax is accordingly quite complex, and can be hard to understand.</li> <li>It is possible to write recursive structures in yaml: <code>{a: &amp;b [*b]}</code>, which will loop infinitely in some converters. Even with circular detection, a "yaml bomb" is still possible (see <a href="https://en.wikipedia.org/wiki/Billion_laughs" rel="noreferrer">xml bomb</a>).</li> <li>Because there are no references, it is impossible to serialize complex structures with object references in JSON. YAML serialization can therefore be more efficient.</li> <li>In some coding environments, the use of YAML can allow an attacker to <a href="https://pyyaml.org/wiki/PyYAMLDocumentation" rel="noreferrer">execute arbitrary code</a>. </li> </ol> <p>Observations:</p> <ol> <li>Python programmers are generally big fans of YAML, because of the use of indentation, rather than bracketed syntax, to indicate levels. </li> <li>Many programmers consider the attachment of "meaning" to indentation a poor choice.</li> <li>If the data format will be leaving an application's environment, parsed within a UI, or sent in a messaging layer, JSON might be a better choice.</li> <li>YAML can be used, directly, for complex tasks like grammar definitions, and is often a better choice than inventing a new language. </li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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