begin  quoting Andrew Lentvorski as of Fri, Jul 06, 2007 at 05:17:23PM -0700:
> Stewart Stremler wrote:
> >XML goes the other way... for simple configurations, it's ridiculously
> >complicated.  And most configuration is key-value -- so you end up using
> >simple XPath expressions to get the data you want, which puts you back
> >into the key-value world, which makes XML just another layer of complexity.
> 
> Except that any useful program evolves and then you have a complex 
> configuration file shoehorned into a crummy config format.

Odd, that's exactly how I think about XML. Someone's shoehorning a
configuration into a crummy config format.

Bleah.

> No thanks.

Exactly. :)

Now...

I suppose if the format is going to suck no matter what, then XML isn't
so bad.  But if your configuration starts to get too complicated, that's
a small that should bring out the refactoring.... rather than saying
"let is suck from the very beginning".

> I don't know why everybody complains about XML.

'Cuz it sucks to work with XML. You need pretty-printers and custom
editors and days of trying to figure out what the hell has gone wrong
with the configuration since the parser now chokes and dies with
"Parse Error, line 3". . .

> You suck the whole tree into memory.  You walk the tree.  Done.

You suck the whole tree into memory. You loop through an array of
XPATH expressions, and store the result in a map. Done. You're right.
It isn't that hard.

It's not the programmatic side of things that's annoying (well, it is,
but that's because XML parsing libraries are not nice in C, C++, Java,
and so forth -- and picking a language based on XML support seems
backwards), it's the me-as-the-user-trying-to-set-up-the-config-file
side of things that's annoying.

You smart people can suck the whole XML structure into your head and
debug it, while us mortals have to slog through the file from start
to finish, trying to figure out what the hell went wrong.

> This is no better or worse than if you used s-expressions, delimited 
> structures, etc.

Well, it's [XML] a bit more code, but that's not where the problem is.

> The big problem is that the people who complain about XML are generally 
> the same people who would complain about *any* hierarchical organization.

I don't think so. I think that's an ad hominiem that's been applied to
those who object to XML, and it's been applied so often that it's become
its own meme.

It's rude.

> Just because *your* language sucks at serialization is no reason to 
> handicap *my* usage of useful data structures.

Just because *you* don't look at configuration files doesn't mean that
*I* should suffer when I go and I look at 'em.  The file format on the
disk should /first/ be for humans. SGML and children ain't for humans.

Now, if you're serializing object structures, by all means, use XML. If
it's not meant for human consumption, I don't really care if you use
XML or binary, except that most folks who design binary formats don't
use or learn from a standard like IFF, and so don't create forward-
compatible formats.

Of course, most of the XML that's been given to me to work with is
designed by folks who don't create forward-compatible formats either,
but at least I can more easily tweak the file so that it will work.

-- 
The people who suck at writing parsers are no better off writing schemas.
Stewart Stremler


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to