Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: An Idiot's Guide to YAML

by perrin (Chancellor)
on Jun 08, 2007 at 23:43 UTC ( [id://620118]=note: print w/replies, xml ) Need Help??


in reply to Re^4: An Idiot's Guide to YAML
in thread An Idiot's Guide to YAML

Does it? For what? Both seem pretty clunky for config files, and XML is probably better for data exchange between different languages since it's better supported.

Replies are listed 'Best First'.
Re^6: An Idiot's Guide to YAML
by doom (Deacon) on Jun 09, 2007 at 08:21 UTC

    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.)

      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

        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.
        get a decent editor with block selection and indenting, I suggest Vim

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://620118]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found