Sunday, March 26, 2006

Is XML the Whitworth thread of our time?
In the 19th century manufacturing was revolutionized when measuring systems and machine elements were standardized. The Whitworth screw thread was one of the most important. It allowed parts from different manufacturing batches, different factories and even different companies to interconnect.
XML promises to do something similar for data, and it's badly needed. Will XML succeed? In a way it already has. When choosing a file format for a new system today XML is the obvious choice. But data doesn't just have form (syntax), it also has meaning (semantics). If two systems are to exchange data they need to agree on both syntax and semantics. XML doesn't specify semantics, a much harder problem than syntax.
Should XML be the default choice for file formats? Probably, but give it some thought first. XML is quite verbose (bad for performance) and not very suitable for human editing without an XML editor. You may think that noone should edit your system's precious files, but in practice there is often some power user who can't resist the temptation to tweak the system by hand-editing files. You could try to make this impossible of course, but tweakability is a good thing and makes your customers come back. So it may actually be a good idea to have configuration files which are easily editable in Notepad. That rules out XML and suggests something like an old-fashoined ini file.
If performance is very important you should consider binary formats, unless easy portability across big/little-endian processors is even more important.

0 Comments:

Post a Comment

<< Home