Question of the day: What configuration file formats do you all like and use?
@lyse@lyse.isobeef.org i made my own :D
I do prefer toml for the old school ini style with added support for object lists.
my second would be hjson or any other json with comments style.
Yeah, the lack of comments makes regular JSON not a good configuration format in my view. Also, putting all keys in quotes and the use of commas is annoying. The big upside is thatās in lots of standard libraries.
I think the appeal with YAML is that is has comments, is kind of easy to write and read and also provides unlimited nesting levels. But it has all its drawbacks, no question. Forbidding tabs, thousands of different string flavors, having so many boolean options (poor Norwegians) etc. I use it, but I donāt particularly enjoy it.
Among simple key value pairs, I like INI files, but with #
for comments, not ;
. I never used TOML, read up on it yesteray before writing this question, but it looks a bit weird and has some strange rules. I guess I have to give it a try one day.
And yes, as mentioned by several of you, it always depends on the complexity of the configuration at hand.
Iām developing something for the scouts at the moment with rather simple requirements on the config. Currently, there are just four settings. Even INI would be overkill with its section. I selected JSON for now, because thatās readily available with Goās std lib. But I do not like it.
Btw. whatās your own config format, @xuu@txt.sour.is?
@lyse@lyse.isobeef.org Lack of comments are definitely a shortcoming of JSON. I donāt like TOML because it lets you have nested categories ([foo] [foo.bar] [foo.baz]
) and it just feels confusing to me, even with indentation. Simple INI files are okay.
The Prosody XMPP serverās configuration file is just a Lua script because Prosody is written in Lua, and thatās excellent.