From: pharrington Date: 2010-01-01T02:35:05+09:00 Subject: Re: Where to find a description of yaml for ruby? On Dec 31, 7:27 am, Fritz Trapper wrote: > Phillip Gawlowski wrote: > > But one thing is annoying with YAML: Significant whitespace. \t or a > > proper space have different meanings, as does the amount of space. > > Thats really a bad issue. After reading docs on YAML, I decided to use > it for plane data only, no structs or trees, as I wanted to. > > > Ain't it grant that > > require "yaml" > > var = Object.to_yaml # or dump, if you want to write a file > > another_var = YAML.load var > > > makes it so very easy to use? And it can be read (not necessarily > > written) by humans, too. > > Yes, that's very elegant and useful für simple configuration files. > > > Try reading and writing XML in just one three lines! ;) > > Reading complex data structures expressed in well formated XML is > possible. Reading the same in YAML is at least quite difficult. > -- > Posted viahttp://www.ruby-forum.com/. Let me ask you: do you also consider JSON to be more complicated than XML? Indeed, representing a complex entity would be hellish with mere hashes, arrays, and scalars. But think about the use case: it is not intended to be able to represent anything and everything. Similarly with YAML: yes, it is a *fantastic* fit for configuration files. It is a *fantastic* fit for serializing objects in a multilingual setting. Can you use it as the basis for your makefile system? Unlikely... But after a little thought you probably don't want to use XML for it, either. This is my (and probably many others') problem with XML: it *can* do everything, but it's almost always the wrong tool for the job. For a simple task, use a simple tool. For a complex task, its probably easier to create a format/system suited to the task (or just think about the task differently!) than to devise endless pages of XML specification.