Re: XML and Config files

pDale <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
On Fri, Mar 20, 2009 at 1:41 PM, Wayne Simmons <[email protected]> wrote:

> >Have you ever heard of "Perl Best Practices"?
> Indeed I have heard of it, unfortunately I have not read it. Perhaps you
> could point out the particular point you were trying to make instead of
> just
> saying RTFM?
>

Did you follow the link (you obviously went to the second one)?  It says...
"Don't use XML as your configuration file format.  It may be human-readable,
but it's
almost never human-comprehensible, and the ratio of mark-up to content is
vastly
too high.  No-one wants to write or maintain a configuration file that looks
like
Example 19-4..."

Bill Lewis makes the same point in his blog (the second link).



> >"Microsoft standard"?  Sounds more like a case of NIH.
> I wish I knew what NIH meant, since that whole sentence hinged on my
> understanding of that cryptic Acronym. I'm guessing it's not the National
> Institute of Health...
>

"Not Invented Here", which actually isn't the best description of that
attitude.  (BTW, are you
aware of <http://www.acronymfinder.com/>? "Not Invented Here" is the #2
match.)



> >In fact, just to turn a crank, what is XML good for, anyway?
> The link you provided was an interesting read, but several of the comments
> below the article reflect my own feelings. That was quite a straw man
> defense; the XML described in the article was poor. His configuration file
> was completely without annotation and impossible for someone to understand
> without additional documentation. Typically a well formed XML file will be
> self documenting. Also as pointed out in the comments the Judicious use of
> attributes means you can glean more information from one quick glance than
> you could be reading an entire non-xml configuration file.
> Ex:
> abraham Blue 1 10   #what does this mean?
> <tank side="blue" move=10 qty=1>abraham</tank>  #this is more clear


I would prefer a header line at the top of the tank entries in the INI,
rather than "move" and "qty" in EVERY entry in the XML file.

BTW, I've been told using attributes this way is a violation of the "intent"
of the XML format.
When I was first starting to learn XML, I laid out a parts-catalog format
using attributes for much of the data, and caught heck from the rest of the
group for it.  Until they decided it was much more readable.


I have in the past made config files perl, and just executed
> them at run time so I can see the draw to use non-xml. However, that one
> came back to bite me too when a non-perl program wanted to access the same
> configuration settings.


Perl code as config file: Another not-a-Perl-best-practice.


as a side note there are several reasons XML is a preferred data transport
> method.


Yes, XML is vastly superior to HTML.  But I don't see CSV going away anytime
soon.

-- 
pDale

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.