Is it XML? Is it JSON? No .. its TOML !

One of the key things of any software project is configuration data. Whether you write client or server side applications, configuration data is an integral part of your development code. Just like everything in live, the preferred mechanisms for configuration file formats has its fair share of choices.

With the advent of XML, it seemed logical that all configuration went the XML route. And it was not a good thing always. The syntax looked verbose, difficult to understand or read and so on. Applications that like to call themselves modern, have started to go down the JSON route for their configuration file format. It is seriously a bad choice in my opinion because configuration data file format is seldom about efficiency, except maybe for some highly specialised applications.

That brings me to the point that when it comes to configuration file formats, prime importance needs to be given to readability. Your job as the application developer should be to use a format that is easy to read. While it definitely depends on your choice of naming configuration parameters, the readability of the format does matter.  This is where personally I think JSON comes up way short, unless you have only a few parameters. XML is fine but it is verbose and at times difficult to read.

Today, I saw a tweet by @jackerhack mentioning about TOML (Toms Obvious Minimal Language). It is a refreshing configuration file format and just one look at the Github README is enough to make me feel like I understood the file format. You can reach your conclusion but I particularly liked the grouping of the properties and its support for multiple data types. It kind of looked like Windows INI files on steroids for me.

Take a look at a snapshot from the Github page:

Screen Shot 2013-03-27 at 11.11.55 PM

The next thing I usually do is to see if I can see multiple ports of this specification and I was not disappointed. There are tons of them in most of the mainstream languages.

Looks neat, doesn’t it ? What do you think?

 

Advertisements

One thought on “Is it XML? Is it JSON? No .. its TOML !

  1. It looks a lot like a standard UNIX style .cfg file. And I like it. =)

    I, for one, am REALLY sick of both JSON and XML being used as configuration files. They weren’t designed for that, and they’re both terrible at it in different ways.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s