From: jbritt@... Date: 2003-03-19T16:41:50+09:00 Subject: Re: XML too hard (YAML opportunity?) > Ah...the key is that you do not design the data file...this is an XML > thing. The to_yaml method creates the format off your object model. So, rather than chose a confg file format that is easiest for my users, I write an app and just live withever what falls out? That can't be right. action: "snip" > it's an integer. If later I decide that floats are better and want > > change > > my > > code, don't the older data files have to be rewritten? > > Actually, what will happen is a Hash will be created with a key > ("some_key") and the value(23). If you change to floats, the Hash will > have the key ("some_key") and the value(23.0). It all depends on your > use of these objects as to whether this will fail. But this is the > same for XML too. If you have a parser that expects a certain format > in the value of an attribute like: > > some_num="23" > > and then do: > > some_num="23.0" > > you have to update your parser. Well, no, I update the business logic that uses string values returned from the XML parser. > If you update it, will it break with > old files? How long does your parser read the old format and convert > to the new? > > > > > > >> Oh, and did I say that YAML files are readable? > > > > You did, but I'm not always seeing that when I read the YAML spec. > > > > And XML specs are readable???...I was talking about the YAML content, So was I. Reading the spec, and looking at the examples, I get the inmpression that once you get past foo: bar examples YAML can be a bit gnarly. But, again, I need to use it more. > not specification. The YAML library deals with the spec. I write Ruby > code and let it emit and parse it. Same for XML. James