Xml for configuration, why?

time to read 3 min | 404 words

Can someone please explain me why we suddenly got XML all over the place? On the top of my head, we have app.config files, nant build files, AOP configuration, NHiberante mapping files, etc.

Why take an application written in strongly typed language - presumably to allow the compiler to catch your errors - and add weakly typed information that would break your application?

Here is an example of using Boo to script a build file (this is very similar to how you would do it in NAnt, but NAnt is not really design to be used outside of XML and I didn't really have the time to find out the exact contortions I would need to do it in code):

import NAnt.DotNet.Tasks

def Build():

csc = CscTask(Debug: true)
csc.References.BaseDirectory = DirectoryInfo("../lib")


Isn't this nicer then trying to make XML into a programming language?  NHiberante allows a nice way to configure it via code, just pass a hashtable with the values. But most of the rest just don't let you do it easily.

I'll probably regret this (I'm currently juggling ~6 projects*), but I'll give you a challange. If you're an application developer and you want to add configuration to your application (that is targeted to developers, of course, if you want user configuration, write a WinForms to do this), just mail me at Ayende@ayende.com and I'll help you add support for configuration in Boo. I'll even show you how to do this in a C# script or Javascript.

* All of them open source, btw.