Brent Saner on 8 Jan 2008 20:12:22 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Config Files (Was: Sharing an Internet Connection)


"common situations" being the key phrase here.

if you want to squeeze this API parsing into a tiny, tiny image to flash to a router, be my guest.

with wide-readability (text PLUS xml PLUS etc.) comes bigger footprint- when you deal with embedded devices, i'd say footprint is one of the top three concerns.

On Jan 8, 2008 9:28 PM, Matthew Rosewarne <mrosewarne@inoutbox.com> wrote:
I'm sure I won't get any friends for saying it, but config files are a
terrible interface (the important word!) to configuring systems in many
common situations.

From the point of view of a developer or someone administering multiple
systems, configuration files provide a largely insurmountable challenge.

1. Configuration files are extremely difficult to edit programmatically.  Many
applications get around this by simply writing "DO NOT EDIT!" somewhere in
the file or having an extremely limited syntax.  Placing such restrictions on
config files negates any benefit from being able to edit them manually.

2. Configuration files are not very granular.  This makes it extremely
difficult to propagate changes to parts of a configuration without
overwriting the whole thing, which is an enormous obstacle to managing
multiple machines or editing a configuration programmatically.

3. When a user modifies a configuration file, the program is typically not
aware of the changes.  While this may be useful in some situations, most of
the time this would involve restarting the program and hoping the changes
don't cause it to barf.  In a high-uptime environment, this is problematic.
It also makes it far more difficult to have hooks run when certain values are
changed.

4. Text files are slow and unwieldy for applications to read or write.  A
configuration file must often be parsed in its entirety in order for any of
its information to be extracted.  Similarly, they usually must be written out
fully for any changes to be saved.  While it might be possible to get around
this with regex magic, it still requires parsing the entire file and is
likely to break.

5. Just about every configuration file has a different syntax.  Not only does
this mean that users must learn all sorts of different syntaxes to manage
their systems, but that a different parser program must be written for every
individual file.  Often this results in a scenario like that of TeX, where
there is only one parser implementation capable of fully understanding the
contents of a file.


There are other issues, but those are the most important ones I can think of
off the top of my mind.  I'm certainly not going to claim that an approach
like the accursed Windows Registry is superior, it's terrible.  The best
option I can think of would be a flexible configuration _interface_
(by "interface" think "API" rather than "GUI") that could be viewed/edited as
a text file, or maybe an XML file, or even an LDAP tree, with the actual
storage being handled out of sight.  I would hope that something such as the
Elektra Initiative would come into fruition and gain more widespread use,
giving us Free software users the best of all possible options.



--
Brent Saner
215.264.0112 (cell)
215.362.7696(residence)

http://www.thenotebookarmy.org

Bill Gates is to hacking as Sid Vicious was to the Sex Pistols: no talent, everyone hates him, and he's just in it for the fame and money.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug