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:
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?