YAML is a little eaisier to mess with in a text editor

It's also a little too easy to mess up in a text editor.

Try merging two YAML structures together manually into one file. The only sane way is to load the two fragments in program, merge as desired, and then write it out. It's really, really hard to write valid YAML by hand and sneak it into a program. It's too sensitive to whitespace.

XML, on the other hand, by and large has no problem with whitespace. This allows you to pull of certain quick and nasty hacks to modify element contents without having to worry too much. Not saying that this is a good idea, but something I've had to do from time to time. But a single misplaced space character in a YAML file will render it unloadable. Thus, in my experience, I have come to the opposite conclusion: XML is much more forgiving of manual edits; YAML is brittle and prone to breakage.

These days I view YAML as an opaque serialising mechanism. You look at it, but don't touch it.

• another intruder with the mooring in the heart of the Perl


In reply to Re^7: An Idiot's Guide to YAML by grinder
in thread An Idiot's Guide to YAML by scorpio17

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.