The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

YAML?

Has anyone ever used YAML in a real life application? If so, how was the experience? Would you recommend it? It sure seems like a nice way to add metadata to a data transmission file, without the XML bloat.
Steve Hirsch Send private email
Tuesday, July 11, 2006
 
 
I've used a subset of YAML and I think it is nice. I definitely think anyone thinking of rolling their own file format should read the YAML specs carefully and think about the way it is done, as an example of something different than XML, which I think is really inappropriate for many things.
Scott
Tuesday, July 11, 2006
 
 
Rails uses it. I'd rather use XML. It's silly to have yet another markup language when XML works fine, bloat or no bloat.
son of parnas
Tuesday, July 11, 2006
 
 
Right. Why use Python when Cobol does all you need.
Scott
Tuesday, July 11, 2006
 
 
Right. Because the differences are certainly comparable.
son of parnas
Wednesday, July 12, 2006
 
 
Hm, sounds like you are an idiot. You are saying that there is one true file format that must always be used and any metaphors comparing that to other situations should just go the fyuck away, just shut up and go away Scott we don't want to hear it you stinking filthy blue bastard.
Scott
Wednesday, July 12, 2006
 
 
I am certainly an idiot, but not using a functional and common format because of "bloat" ain't so smart either.
son of parnas
Wednesday, July 12, 2006
 
 
Scott just doesn't like it when he can't write a parser for his own custom file format; XML ruins all his fun.
Almost H. Anonymous Send private email
Wednesday, July 12, 2006
 
 
No, I've used XML, YAML, and other formats. I am reacting to the retarded attitude that XML is good enough for everything and to choose any other format is 'silly'.
Scott
Wednesday, July 12, 2006
 
 
XML certainly got more support than YAML, no?
DotNetNoob
Wednesday, July 12, 2006
 
 
I use YAML in Ruby to persist the preferences of the applications, much like people would use INI files, the registry on Windows, and XML.

Basically it works like XML works in other languages -- the streaming is supported by the reflection of the language.

But this data in YAML files should be pretty unimportant. For anything important it's better to use a proper database.

If the version of Ruby changes too much, like between the stable version and the one in development, it may cause some problem with the YAML file. But I think it's updated automatically to the newer version, though it may not work the other way around, like in a downgrade.

I could use XML instead, but I generally avoid it. YAML does the job in a cleaner way which is good enough.
Lostacular
Wednesday, July 12, 2006
 
 
I had a quick look at yaml and was quite surprised at how complex the specification was for a supposedly simple format.
Tony
Wednesday, July 12, 2006
 
 
YAML files can get quite complex, mainly with so many automatic streaming of deep hierarchies. Hence, it's serious business, but if done right, you will reuse the existing parsers and help to improve them. XML might be easier to parse, but some XML files can get quite complex as well.
Lostacular
Wednesday, July 12, 2006
 
 
One advantage of yaml is that it is much more human readible than xml. So for situations where that is an issue it's worth a look.
Scott
Wednesday, July 12, 2006
 
 
-1 on the personal insults. No need for them.

YAML stands for YAML Ain't Markup Language, it's a different animal than XML languages. I was all set to go for it, but then I did read the spec, and it is amazingly complex. I was wondering if there were any YAML <==> relational converters out there already, kind of the equivalant of XML shredding functionality.
Steve Hirsch Send private email
Wednesday, July 12, 2006
 
 
Agreed, -1 on the personal insults.

In particular, Scott might consider backing off on the agression, where his second post is snippy and sarcastic, and his third post calls someone an idiot.
Anonymous here
Wednesday, July 12, 2006
 
 
"XML is good enough for everything and to choose any other format is 'silly'."

It is silly.  XML isn't good enough for everything but if you're going to store structured textual data, you might as well use XML.  Creating more and more file formats just for the hell of it does nobody any good.  Just the small amount of standardization on XML has done wonders for our industry.
Almost H. Anonymous Send private email
Wednesday, July 12, 2006
 
 
AHA, this is the exact same argument that we should just use one language. That language should be C++ because it is the only cross platform language with universal support and acceptable performance. If you think that such an argument is foolish, you must also agree that saying XML is what everyone should use is foolish as well. The only people who make these arguments are people who are incompetant coders who cant write an XML parser, or any other one, but found one included in their pet language or some open source library. It's like someone who only speaks Vietnamese saying that everyone in the world should speak Vietnamese because it's good enough for them and it's a standard.
Scott
Wednesday, July 12, 2006
 
 
If you guys don't like being called stupid for prometing idiotic closed minded ideas, you probably won't be able to handle life in any real development company like Microsoft or Apple.

"That's the stupidest idea I've ever heard and you are an idiot." - Bill Gates
Scott
Wednesday, July 12, 2006
 
 
YAML's terse, and its syntax explicitly maps onto common basic data structures.  It's good at serializing data for scripting languages that use those data structures.

It's basically a middle ground between binary serialization and XML.  So if you're using a language whose data structures are scalars, arrays, and hashtables, and your application doesn't need the performance of binary serialization, and it doesn't need any of the benefits that XML provides (e.g. a generic object model, validation, transformation, query, namespaces), you should look at YAML. 

I don't like YAML, but not because of anything wrong with YAML:  I don't like the problem it's trying to solve.  I don't like working with a bunch of arrays and hash tables.  I like working with classes that hide those arrays and hash tables from me and that use reflection to produce serializations when I need them.
Robert Rossney Send private email
Wednesday, July 12, 2006
 
 
> you probably won't be able to handle life in any
> real development company like Microsoft or Apple.

Let's see, I've worked at a dozen or so very real development companies and I have never even heard anyone called stupid before. Ever.

If you think it's OK because a really rich person like Bill Gates does it then perhaps you should go talk to your mother and have her give that "would you jump of a bridge because your friends did it" speach again. Apparently you like to justify giving into your infantile urges by arguments from authority.

> this is the exact same argument that we should just
> use one language.

What are the languages try to accomplish? Perhaps they aren't as similar as you think. They usually aren't.

And it's fine to use a technology because you like it, just don't try to make it an objective fact of reality with technically inferior arguments like "bloat."
son of parnas
Wednesday, July 12, 2006
 
 
"AHA, this is the exact same argument that we should just use one language."

I specifically said "if you're going to store structured textual data".  Certainly if you need a low-level compiled language with manual memory management you should be using C++.  There's really no point in using ADA or invent yet another similar language to do it. 

"If you think that such an argument is foolish"

But see, I don't.

"The only people who make these arguments are people who are incompetant coders who cant write an XML parser"

Conversely, the only people who support making an new file format for everything are incompetant coders with not-invented-here syndrome with the ridiculous need to reinvent everything themselves.

"It's like someone who only speaks Vietnamese..."

By international treaty, the official language for aircraft/airport and maritime communication is English.  What, exactly, do you think of that?
Almost H. Anonymous Send private email
Wednesday, July 12, 2006
 
 
parnas, you are such a fool. I bet you do this to your poor boss as well, don't even bother to listen carefully before spouting off your mouth ignorantly.

I didn't use the word bloat.

But since you mention it, do you feel that XML is a good choice for containing sets of digital images that must be transmitted over a network for live playback? If not, why not?

Dumbass.
Scott
Wednesday, July 12, 2006
 
 
"What, exactly, do you think of that?"

As an occasional pilot, I think it makes sense. But if I swagger into a bar in Côte d'Ivoire and announce that English is the official aviation language and so everybody better start talking it and cut out this backwards french nonsense, what do you supposed their reaction would be?
Scott
Wednesday, July 12, 2006
 
 
> But since you mention it, do you feel that XML

Why would you care what a foolish dumbass such as myself would think?
son of parnas
Wednesday, July 12, 2006
 
 
I don't. I feel sorry for your level of cluelessness. I often try to teach pigs to sing, but you're right, it's probably a big mistake.
Scott
Wednesday, July 12, 2006
 
 
> I feel sorry for your level of cluelessness.

I am touched by your empathy. Bill Gates and your mother would be proud.

> I often try to teach pigs to sing

Given your "only one langauge" style arguments this does not surprise me.
son of parnas
Wednesday, July 12, 2006
 
 
And they say software developers are badly socialized.
Robert Rossney Send private email
Wednesday, July 12, 2006
 
 
<quote>
If you guys don't like being called stupid for prometing idiotic closed minded ideas, you probably won't be able to handle life in any real development company like Microsoft or Apple.
</quote>

I may be new here, but I would tend to think I'd want to make sure I could spell "promoting" properly before I started calling other people stupid.
anon
Thursday, July 13, 2006
 
 
Is anybody else here a little tired of Scott's trolling?

I have seen some other forums where useful discussions are littered with wanton diatribes. I like this place and I feel that Scott is polluting the bandwidth with his vitriol.

Scott, for the collective good, could you please tone it down? This is not /. and I am happy about that. Let's keep it civil.
Not Really Here Send private email
Thursday, July 13, 2006
 
 
BTW I think YAML is great.
Not Really Here Send private email
Thursday, July 13, 2006
 
 
I am sorry for my trolling. I did not realise I was annoying people.

Sorry about that! Point taken.
Scott
Thursday, July 13, 2006
 
 
That's OK Scott. We are all friend's here!
NotReallyHere Send private email
Thursday, July 13, 2006
 
 
So not really here, why do you think YAML is great? Inquiring minds wanna know, considering that's why I started this thread! (:=)
Steve Hirsch Send private email
Thursday, July 13, 2006
 
 
I could not say it better than yaml.org...

    * YAML documents are very readable by humans.
    * YAML interacts well with scripting languages.
    * YAML uses host languages' native data structures.
    * YAML has a consistent information model.
    * YAML enables stream-based processing.
    * YAML is expressive and extensible.
    * YAML is easy to implement.

I like it for the first and last reason the most. Compared with using XML (particularly with Ruby) YAML is mega-trivial.

Life is too short to figure out if an object's properties are tags or attributes. Sheesh. HTML 1995.
NotReallyHere Send private email
Thursday, July 13, 2006
 
 
Well said. I think I like YAML better than XML ow!
Scott
Thursday, July 13, 2006
 
 
I think I like YAML better than XML <i>now</i>. My spelling (again)...
Scott
Thursday, July 13, 2006
 
 
I guess what I'm really concerned with the amount of overhead it adds. I would like to add a bit of metadata to the data stream, validation and all, which is one of the many drawbacks of XML languages.
Steve Hirsch Send private email
Thursday, July 13, 2006
 
 
I've looked at YAML a couple of times now. Every time, I get buried in that massive spec that doesn't really seem to say a whole lot.

While I do think that YAML is a compelling replacement for the .INI file, and possibly a good choice as a data serialization format, XML is still the leader for me.

I personally think that the power of a format is less about the details of the format and more around the standardization. XML has TONS of extra infrastructure that you can use to get a lot of stuff done that you'd have to write by hand with YAML. Thinks like:

 * Schema
 * Validation
 * Transformation
 * Streaming

I really like that I can take an XSD document, point a program at it, and get classes out that wrap the XML format. Best of both worlds - a nice programming model for me, and a standardized representation to the outside world.

The real power of XML isn't from the angle brackets, it's from the agreement that everyone will put them in the same place.

Kind of reminds me of the mp3 vs. ogg vs. wma vs. aac music format wars. MP3 won because it was good enough and everyone had already implemented it.
Chris Tavares Send private email
Thursday, July 13, 2006
 
 
I remember at a trade show that there were software packages being showcased from multiple vendors with...XML connected software modules as a selling point.  Much like I am seeing AJAX being the latest buzzword compliancy check for your software to be anything that is anything.

My advice?  (Yes, I do have a point)  Know what the software your write does.  Don't buy into "automagical" and "wizards" or one-line code generators without knowing what is actually going on underneath it all.  This goes double for your data.  Only under these circumstances can *YOU* actually arrive at the best technological decision for file format specification *AND* implementation.  Any enterprise developer can not reply honestly that he/she hasn't thrown information in a database at some point in their career without thinking, even though flat files are the GOTO of the OOP and structured programming world, perhaps the database was overkill after the fact.

...Didn't THE original developer of Ant later admit that specifying XML as the configuration files was a mistake?  Not that I am using this to slam XML, just a point in general.

In the interest of adding commentary specific to the original posters question:  I prefer YAML over XML however I seem to deal more with XML in practice than the other way around.  XML definately won the popularity contest; regardless of your opinion or mine.  I have used both but a whole lot more of XML than YAML.

One other quick point since I missed noon check-out time on the soap box here - If "it" has passed word of mouth enough to land on your radar screen of new things you don't know about, might as well get familiar with it  by looking at it youself if you haven't yet...That doesn't mean you have to be the next resident expert, but it is the nature of our field...To be open to new ideas and curious; but again, my own empirical opinion so take it as such.
I still use C++ though Send private email
Thursday, July 13, 2006
 
 
I use YAML as an interim format for exporting and importing data between four systems (need to aggregate the data from three databases, and import it into another, new, single database).

It is fine and works out well because there is good Ruby support, and ruby is what we are using to do the data munging. However, it isn't very interesting to think about and not something I would ever bring up in polite conversation. File formats should be on the same cognitive importance level as extended warranties, tax forms, and insurance policies.

Friday, July 14, 2006
 
 
Another simple file format to look at is JSON:
http://json.org

Tuesday, July 18, 2006
 
 
JSON looks cool. I do declare, that YAML specification is intimidating. But YAML is a really cool name, tho'.
Steve Hirsch Send private email
Tuesday, July 18, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz