.yaml, .toml, etc?
I usually use Json5. It’s JSON, but with all the weird quirks fixed (comments added, you can use hex numbers, you can have trailing commas etc.)
A lot of good answers but I would add one note:
- use a format that supports comments, and JSON is not one of those…
JSON by a mile. I hate the YAML plague, it’s some of the most unintuitive syntax I’ve seen and yet it’s everywhere in DevOps/SysOps.
The only thing that really annoys me about JSON is that it doesn’t allow comments.
Yeah, any language in which whitespace count is semantically significant can go suck fat nards.
Not sure whether fantastic troll or just no exposure to Python.
Either way…I’m here for it.
Neither, I’ve written plenty of Python and I know how useful it can be. However, as someone who is neurospicy, I find languages that have semantically l significant white space to be frustrating to read.
Sure, there are tools to help with it. Sure, they help. But they don’t replace how much more useful curly braces are at defining scope.
It depends what you need your configuration file to be:
Need a well defined easy to understand concrete configuration file?
- Use
.toml
. It was made to be both human and computer friendly while taking special attention to avoid the pitfalls commonly found in other configuration files by explicitly stating expected types around commonly confused areas.
Need a simple to implement configuration file?
- Use
.json
. It’s famous for being so simple it’screator“discoverer” could define it on a business card.
Need an abstract configuration file for more complicated setups?
- Use
.ncl
. Nickle allows you to define functions so that you can generate/compute the correct configuration by changing a few variables/flags.
.ini
ducks