Software engineers on Twitter -- do you feel Yaml is a good choice for configuration files? If not, what do you like to use?
Conversation
JSON, INI, anything with syntactic structure.
Oops, you missed 1 space? sorry your whole thing is broken.
I've seen live systems go down because someone added 1 extra space somewhere.
ofc validation etc etc, just no, no no no.
3
7
Show replies
Replying to
I’m not a software engineer but I always use Yaml for configuring parameters in my ML pipelines. It’s very good when you have multiple pipelines in one study. One yaml file does all the jobs
1
Replying to
If your config file is just a mirror of your program’s CLI flags/args, I think you can usually get away with a simple <key> <value> or INI-style config format, and I prefer this. If you need support for objects, hierarchy, arrays, etc., YAML or TOML are much preferable to JSON.
1
2
By the way, check out YAMLLint (github.com/adrienverge/ya) and Prettier (github.com/prettier/prett), they work really well together when writing YAML
2
Replying to
I prefer json, but probably only because I use it more and am more familiar and therefore quicker to find errors.
Replying to
I find myself using INI as a consequence of Python configparser. It's a decision I'm tired of thinking about.
Replying to
Ignore the YAML haters, it's a good format. Extra vote for yaml if you've got any docker compose or existing YAML configs in the same project - having a mix of YAML TOML and ini configs is a nightmare, best to minimise the number of different types. JSON for configs is awful.
1
i will say though YAML gets horrible if it grows too large - look at some kubernetes yaml for example - it's impossible to work with effectively without additional tooling and breaking it down into smaller files.








