The YAML Document from Hell
5 hours ago
- #YAML
- #Configuration
- #JSON
- YAML is criticized for being overly complex and deceptive in its human-friendliness.
- JSON is highlighted as a simpler and more stable alternative to YAML.
- YAML's complexity is demonstrated through examples like sexagesimal numbers, anchors, aliases, tags, and the infamous 'Norway problem'.
- Non-string keys and accidental numbers in YAML can lead to unexpected parsing results.
- Syntax highlighting in YAML is unreliable due to varying implementations and versions.
- Templating YAML is discouraged due to its error-prone nature.
- Alternative configuration formats like TOML, JSON with comments, and generating JSON from languages like Nix or Python are recommended.
- The conclusion advocates for TOML as a safer configuration format and generating JSON when YAML is unavoidable.