|
I used to think YAML was friendly for humans to read. Then I wrote a parser for it, and discovered all the weird corners, edge cases, etc. I now consider it to be a fairly user-hostile format, which should be avoided in favor of just about everything else (XML, JSON, TOML, text protobuf, etc are all more friendly). For example, consider this map of regions in YAML: regions:
northamerica: [ca, us, mx]
scandinavia: [dk, no, se, ax, fi, fo, gl, is, sj]
Spot the error!Writing a parser is also a bit of a nightmare, because there are a bunch of features which can turn a bit dangerous if you’re not careful—things like cyclic graphs or declaring types of objects. These are complete non-issues for the other formats I listed above—they’re all trees, and it’s very unusual for parsers to let you instantiate unintended types with those formats. |
I know this is rhetorical, but I've been bitten by this enough times so for those who don't know `no` will translate to a boolean false.