The new .net uses json, it's awful. No comments allowed and it get's pretty unreadable when you have nested configuration elements.
So I use JSON-with-comments, but the app only sees the stripped files.
I guess they figured it may not be correct JSON, but since they aren't sending those particular JSON files anywhere it doesn't matter?
The proto text format is actually more flexible and less verbose than JSON since it does not require the outer enclosing set of braces and quotes around all the keys and has support for comments.
Here are a couple of examples of config files using the Protocol Buffers text format:
* Bazel CROSSTOOL: https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CR...
* SyntaxNet: https://github.com/tensorflow/models/blob/master/syntaxnet/s...
[0] https://developers.google.com/protocol-buffers/docs/overview...
[1] https://developers.google.com/protocol-buffers/docs/proto3#j...
This is what I ended up doing:
False dichotomy.
Better than XML and binary blobs:
* JSON (assuming everyone knows what this is)
* YAML [0]
* Lua tables (if you're already using Lua as a scripting language; Lua started out as a configuration language after all)
* INF format [1] (not my favorite, but pretty easy to parse and much better for humans to read than XML)
* Any of the above compressed with a gzip compatible compression (if size matters, though it rarely does these days)
Even Protocol Buffers [2] are better than XML, though at that point it becomes a "documented binary blob". But as long as the spec is shared, the format can easily be read by just about any programming language.
[0] https://en.wikipedia.org/wiki/YAML
[1] https://en.wikipedia.org/wiki/INF_file
[2] https://en.wikipedia.org/wiki/Protocol_Buffers