Subject: Re: XML config file
To: NetBSD User-Level Technical Discussion List <>
From: Jonathan A. Kollasch <>
List: tech-userlevel
Date: 07/23/2006 21:54:41
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 23, 2006 at 04:05:40PM -0400, Greg A. Woods wrote:
> At Fri, 21 Jul 2006 14:47:59 -0700,
> Jason Thorpe wrote:
> >=20
> > Perhaps I've simply grown so used to it... I now actively DISLIKE the =
> > flat config files that BSD uses, because of their lack of structure :-)

Structure could be considered to be in the eye of the beholder.  I already
have a good amount of mental investment in knowing the structure of
various unix configuration files.  Given a blank file there is nothing
defining it's structure for you, you have to know the type of
syntax/structure that is expected.

> Perhaps the ability to represent deeper and tree-like structure and is
> nice, but XML (or anything SGML-related) really isn't the right answer
> for adding any kind of structure to any file format intended to be used
> by both humans and machine.

Well, termcap(5) is one of the least human-readable formats out there,
and has no place being used in as many places as it is.  When I was thinking
about what an XML version would look like it got to be too much for me.

> Just because it's commonly used for such purposes doesn't make it right
> or good.

Look at Windows :)  There they moved from .INI files to The Registry.
The Registry is the ultimate in non-human-readability, but it is perfectly
suited for having GUI front-ends to it.

> (the C-like syntax used by BIND and their ilk isn't really all that
> great either of course, though it's a damn sight better than XML)

There are a good number of files that I really like the "flat" format of.
The key/value(s) pair is one of the most simple syntax structures that exis=
and is well suited for many of the standard configuration files.

For example, were we to switch to an XML format, this is a bit of what
I've theorized that might look like.




<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>

One of the worst examples I came up with was for /etc/shells,
a newline delimited list is one of the best structures for
a list of things.  /etc/ttys also becomes a lot more complex.

Anyway, without structure, we wouldn't have configuration files
as we know them.  At least no one has suggested using English
for these things :P

	Jonathan Kollasch

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.2 (NetBSD)