Useability is not good
Useability is not good
Posted Dec 17, 2025 13:48 UTC (Wed) by mbunkus (subscriber, #87248)In reply to: Useability is not good by pizza
Parent article: Conill: Rethinking sudo with object capabilities
The JSON standard that's actually called JSON (aka ECMA 404 aka RFC 8259) does _not_ allow for comments and several other things that would make using it easier for humans (e.g. trailing comma after last array/object element, multi-line strings with \n instead of \\n) Most JSON parsers out there do fail to parse JSON documents that contain JavaScript-style comments.
There are other standards/projects with similar names such as JSON5 that _do_ have those features, or jsonc which is base JSON with comments. But that's not JSON.
And neither is JavaScript.
Sorry for being pedantic here; this is just a pet peeve of mine. In my opinion there's simply no really good text configuration format. Some of my objections:
- JSON: lack of support for comments, multi-line strings, trailing commas
- JSON: no (consistent) support for 64-bit integers (or larger) in a lot of parsers
- YAML: huge complexity due to all the features
- YAML: security implications due to object type thingies
- YAML: way too lenient with string values & trying to auto-guess data types resulting in a lot of surprising conversions that highly depend on the parser used
- YAML: incredibly easy to screw up the format for inexperienced authors
- YAML: sub-par tooling support due to lack of structural information in the format itself
- TOML: nested hashes requires repeating all upper-level key names over & over again (e.g. "[settings]" → "[settings.auth]", "[settings.database]" etc.)
- TOML: lack of wide-spread language support
- XML: attributes vs data in child elements
- XML: easy to create structures that don't map 1:1 into array/hash hierarchies
- XML: without external type information it's impossible to know what's supposed to be array-like & what isn't
- XML: even less type information than any of the others
Even despite all of its drawbacks I tend to use YAML a lot more than JSON for anything that a human has to touch semi-regularly (e.g. Ansible stuff), simply due to basic JSON being so anti-maintenance.
