From: Phillip Gawlowski Date: 2011-03-16T00:28:28+09:00 Subject: Re: Understanding YAML and this practice in general On Tue, Mar 15, 2011 at 4:06 PM, Piotr Szotkowski wrote: > > Without YAML I’d have to create a storage format that takes into > account the signature’s body, author, subject, source and tags > – with YAML I just serialise the signature object and I’m done. > On the flip side, if I even find a typo in a signature, I can > easily directly edit the YAML file˛ and be done with it. Neither of this is, of course, limited to YAML. YAML just has the benefit of being shipped with Ruby's standard library, thus it is ubiquitous within the Ruby world. That doesn't mean it's the best, simplest, or most efficient tool to store any ol' text in a programming language-compatible way (that's highly usage based, since sometimes performance matters, sometimes a small footprint in LOC matters, sometimes the time is limited to solve a problem, etc.). YAML's excellent at storing Ruby objects in a human-readable fashion, and importing them again Somewhere Else. It's excellent for configuration data, or simple jobs (I used a Ruby website templating engine using YAML for single pages/posts many moons ago), but falls apart when your data doesn't easily fit into the Ruby object mold (i.e. Hashes, Arrays, Strings, &c.). Which brings me to a nicely apropos email signature: > The good thing about reinventing the wheel is that you can get a round one. >                                         [Douglas Crockford on JSON vs XML] The difference between JSON / YAML and XML is that that JSON and YAML do one thing, and do it well(-ish), while XML is extremely flexible. On the downside, that means JSON or YAML doesn't always work well(-ish), while XML is extremely flexible. -- Phillip Gawlowski Though the folk I have met, (Ah, how soon!) they forget When I've moved on to some other place, There may be one or two, When I've played and passed through, Who'll remember my song or my face.