4 ms·
XML is a fine markup language for anything that looks like a document, but a very poor configuration format. JSON is a great text-based exchange format and pro
by atemerev 4y ago
XML is a fine markup language for anything that looks like a document, but a very poor configuration format.
JSON is a great text-based exchange format and protocol medium, but extremely poor configuration language (no comments, no references, very restricted syntax for human editing).
Every tool has it uses (for configuration purposes I suggest something like HOCON, or even some superset of INI, like Python’s configparser).
YAML is bad at everything.
- nerdponx 4y agoYAML is fine at deeply-nested configs (where TOML kind of falls over), support for multi-line strings in a variety of formats is nice, and the ability to use references and anchors makes it good for things like defining a schema with reusable components. Mistakes were of course made with the "friendly" booleans (yes/no unquoted strings). The Docker Compose and OpenAPI formats, are good uses of YAML that would be cumbersome in any other format. Is HOCON better? Maybe. As far as I recall it doesn't have any affordance for multi-line strings, which I see as a valuable YAML feature. It does have its own merits, though, and is probability a better default than YAML in a lot of projects. But at least if you want an INI-like format, use TOML instead of an ad-hoc underspecified alternative.