XML diarhhea
XML has been the buzzword in the industry for the last few years. I'm starting to really, really wonder why. Take Web Services (please). How is this not a complete redo of CORBA, but using a textual format so as to slow the whole thing down? Heck, the WS* working group has even gotten as bad as the OMG used to be in terms of spewing out specs that no one cares about. Then there are configuration files. Everything needs to be in XML now. Again I ask, why? I have a simple theory about configuration files - they should come in one of two forms:
- Simple data that the user may be expected to hand edit? Use an ini (key=value) style file. Why? Because they are simple, and anyone can figure them out. Hand editing an XML file is just asking for trouble.
- More complex data that will only be changed by the application, or some application provided editor. This should probably be in a binary format so as to discourage hand editing. If the data is in a form that it should only be manipulated by the application, a textual format is the last thing you should be using
This is why I use an ini file for BottomFeeder settings. Knowledgeable users can hand edit the file to tweak settings, and it's obvious what the format is. I use a binary format for the application data - for one thing, it was too big to be optimal XML, and for another - I don't really want anyone trying to hand edit it. More and more, I'm finding that XML is becoming the useless answer to every question...


Comments
XML diarhhea
[ Michael Lucas-Smith] October 27, 2004 20:28:46.932
Comment by Michael Lucas-Smith
What format would you put RSS in instead? Or the content in each RSS item?
[Troy Brumley] October 27, 2004 20:55:37.177
XML is just another tool, and it has a proper domain. An ini file is not such a good thing for XML, though we have looked at doing that in a few things. I think it's a good format BETWEEN systems, but inside a system, use whatever makes sense.
ini xml
[bryan] October 28, 2004 4:31:34.756
I disagree, ini files are perfect for xml as long as the following is done:
by having that I can
These rules if followed give the most extensible and easy to use xml, unfortunately people with other agendas want to place xml schema etc. on top of all that. even in cases where it isn't necessary, thus making everyone fall down, tear their clothes and pour dirt on their face screaming that xml is too complicated.
ini files are horrid
[Elliotte Rusty Harold] October 28, 2004 8:27:33.585
I hate editing .ini files by hand. It looks easy but it never is. For instance:
- Does it require a particular line break at the end of each line? If so, which one, \r\n, \n, \r?
Every .ini file answers these questions differently, and these are hardly the only issues. More often than not, the answers aren't documented anywhere and you just have to experiemnt and hope.Every single one of these questions is answered in a standard way in an XML document. You never have to debug the syntax. A well-defined syntax helps users (at least the sort of advanced users who ar elikely to be editing ini files in the first place). .ini files are not a well-defined syntax.
One size doesn't fit all
[Rob Meyer] October 28, 2004 10:55:42.459
Why expose application data or complex configuration as XML? For one, you get the parser and serializable for free. It may not be a perfect representation, but you don't have to write it, it's available for just about any language you can imagine. And, it allows your users to use your application in ways that maybe you hadn't anticipated. As always, there are different audiences. I've been a system administrator for a long time, and any server-side application that keeps its configuration (or data that I might be interested in) in a closed binary format are frustrating to deal with. Maybe I want to generate the config from scripts or templates, maybe I want to move it from platform to platform, maybe I want to put it under revision control.
By saying "you don't need to worry about those details," the application designer is dictating how I will use the application, which is just going to make me like it less. If having such details hidden is considered to be a competitive advantage, then that's fine and within your rights, but it's also within my right to choose a different program, which I happily will.
Configuration files
[James Robertson] October 28, 2004 11:41:52.704
To reiterate, I see two cases:
My point is, XML doesn't really work for non-technical end users...