3 ms·
Indentation-based config languages really need to be retired. Unless you put in extra work to validate your config, they are just error prone and impractical. T
by beders 5y ago
Indentation-based config languages really need to be retired.
Unless you put in extra work to validate your config, they are just error prone and impractical.
They don't compose (INI files do, btw), they need special editors to keep sane when copying and pasting.
If you now add an invisible type layer on top of them, it doesn't get better, it actually gets worse. Now the interpretation of a value in the file not only depends on the literal interpretation by the human brain but on some type definition one needs to be aware of, adding a semantic interpretation that can be non-obvious.
That is why we have micro-formats: they are obvious (mostly).
http:// http:// 03-13-1980 123e4567-e89b-12d3-a456-426614174000 "I'm a string"
There's a delicate balance between readability and correctness and safety.
YAML et. al. are not hitting that balance.
And if you really, constantly, need to edit config files and can't handle a format that prioritizes correctness over readability: Build a UI.
- darthrupert 5y agoYep. YAML especially is just horrifying to use unless you have internalized how lists and dicts work. After 5ish years of working with YAML files, I haven't. TOML is an excellent contemporary choice that is not unpopular. HCL might be another, but unfortunately not very popular outside Hashicorp tools.