3 ms·
Except he didn't use a number type, or at least didn't think he was: YAML allows you to write strings without quoting them, and has heuristics to decide if an u
by kelnos 3y ago
Except he didn't use a number type, or at least didn't think he was: YAML allows you to write strings without quoting them, and has heuristics to decide if an unquoted thing is a string or something else.
For another example: YAML 1.1 would treat "yes and "no" as boolean true and false. I've heard this called the "Norway Problem":
country: no
Whoops. I had never actually considered the issue in the article, and I wonder if I've ever made a similar mistake with numbers and didn't realize it.
Honestly I think I would be fine with YAML if strings were required to be quoted. Yes, that would make things a tiny bit more verbose, but it would remove a big footgun.
- emodendroket 3y agoYeah that probably would have been better. Can’t really change it now though. I think everyone who uses a lot of YAML is aware of this issue and would know exactly what happened immediately; it’s up there with Java string compares by reference in terms of “everyone using the tech knows this pitfall.”