Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
oodles of name=value pairs

Just how does XML make the process any simpler? consider this
<xml> <host1> <hostname>foo</hostname> <function>Serve intranet content</function> <transport>TCP</transport> <port>80</port> </host1> </xml>
as opposed to an .INI
[Host1] Hostname=Foo Function="Serve Intranet content" Transport=TCP Port=80
I certainly see the latter as simpler, neater, easier-to-type, consuming-less-space, more legible and less error-prone, etc.

IMO that out-of-the-box an .INI style configuration file is relatively simple to use. The way the format is inherently structured ensures good readability for humans to readily glean information from the contents. Little is likely to go wrong as there is a very neglible amount of markup to get in the way. Writing/using a parser for the format is quite easy and handling exceptions is also straight-forward, there aren't too many exceptions.

XML on the otherhand allows for structured information like nested or heirarchical configuration data. It is well portable and it's a standard, so the data is readily avaialble for any program to use. However, since XML is structured and is dependant on well-formedness, a single mis-punctuation or missing tag can lead to XML being not so forgiving. That coupled with the fact that XML uses a lot more markup (which can and usually does get in the way) doesn't readily produce neat and legible information, atleast from a human perspective.

You can argue that XML might be made to work by neatly laying out the information as per a DTD or by using an XML aware editor, but IMO that writing a DTD is extra work just to get XML to work when there are better, cheaper, easier alternatives, not all editors are clever either. Anyone editing the XML must adhere to and be knowledgeable of the DTD. In cases where the XML is dependant on its meta-data (DTD/XSD/XSLT,etc) which isn't avaialble, everything falls apart.

The .INI style config. file has been around since the beginning of computing, it's simple, legible and for the same reasons, quite popular. There are modules in almost every language to write, manage, maintain, verify, etc .INI files. I'd choose it over XML even if humans rarely had to manage it because there might come a day when a person might have manually make changes, and if that were under stress, I'd like to ensure his job were to on as smootly as possible.

There are also humans to consider

In reply to Re: Config Files Redux by Firefly258
in thread Config Files Redux by traveler

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-10-23 23:16 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (88 votes). Check out past polls.