Every time I use YAML, I bump into things even I copy paste from exact working configurations.
Today I learned I’m not just alone, but there is even a term for it: “YAML-NOrway Law.”
[Wayback/Archive] I’d like to propose the “YAML-NOrway Law.” “Anyone who uses YAML long enough wil… | Hacker News
I’d like to propose the “YAML-NOrway Law.”
“Anyone who uses YAML long enough will eventually get burned when attempting to abbreviate Norway.”
Example:
NI: Nicaragua
NL: Netherlands
NO: Norway # boom!
`NO` is parsed as a boolean type, which with the YAML 1.1 spec, there are 22 options to write “true” or “false.”[1] For that example, you have wrap “NO” in quotes to get the expected result.
This, along with many of the design decisions in YAML strike me as a simple vs. easy[2] tradeoff, where the authors opted for “easy,” at the expense of simplicity. I (and I assume others) mostly use YAML for configuration. I need my config files to be dead simple, explicit, and predictable. Easy can take a back seat.
[1]: [Wayback/Archive] http://yaml.org/type/bool.html [2]: [Wayback/Archive] https://www.infoq.com/presentations/Simple-Made-Easy
Even a key Ansible author seems to regret using YAML: [Archive] Kevin Honka on Twitter: “@hikhvar @isotopp jap :) Muss da immer an den Spruch des entwicklers von Ansible denken: Hätte ich gewusst, wie einfach es ist in Python eine DSL zu bauen, hätte ich nie YAML verwendet” / Twitter
Somewhere in the tread, Kris mentioned [Wayback/Archive] Code rant: The Configuration Complexity Clock:

It seems to be a recurring issue in both Kris’ and my life: One needs to actually fail in order to get a feel for reality.
Via [Archive] Kris on Twitter: “Die YAML Spezifikation gelesen. yaml-dox-url Jetzt habe ich Alpträume. “Erkläre Node Tags, Complex Keys mit ?, resolved und unresolved tags, und partial representation.”” / Twitter
[Wayback/Archive] YAML Ain’t Markup Language (YAML™) revision 1.2.2
–jeroen
Read the rest of this entry »