XML is probably better for data exchange between different languages since it's better supported.
That's a point in favor of XML, but the argument against it is that it tends to be bloated and hard to read and edit manually. YAML is a little eaisier to mess with in a text editor (I know someone who's totally addicted to it, he does things like type up his "TODO" lists in YAML, so he can write little perl scripts to sort them, etc.)
| [reply] |
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
| [reply] |
These days I view YAML as an opaque serialising mechanism. You look at it, but don't touch it.
I agree, it's not easy to make large scale edits, but it is useful if you just need to tweak the odd value here and there. I think the readability of XML is a real issue, which is one reason we've seen the rise of JSON.
| [reply] |
get a decent editor with block selection and indenting, I suggest Vim
| [reply] |