3 ms·
OK, I heard him out and I didn't really hear much of an argument so much as handwaving about how YAML is bad. He's provided exactly one edge case where it didn
by emodendroket 3y ago
OK, I heard him out and I didn't really hear much of an argument so much as handwaving about how YAML is bad. He's provided exactly one edge case where it didn't do what he expected because (I guess, if I understood the context) he used a number type where a string would have worked better. Which serialization format is immune to those issues?
- kelnos 3y agoExcept 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.”