Can you tell at a glance what is wrong with this YAML snippet:
scandinavia:
SE: Sweden
NO: Norway
FI: FinlandI had to spend half an hour debugging a bizarre side effect of that parsing to pinpoint the problem.
Edit, holy fuck all these are booleans:
y|Y|yes|Yes|YES|n|N|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF
kittyBreeds = ["Himalayan"
,"Bengal"
,"Siamese"
,"Burmese"
,"Cornish Rex" //rawr
,"LaPerm"
,"Manx"
//This is not a real cat! >:(
// ,"lolcat"
,"Munchkin"
,"Ocicat"
];
In this way the issue with the commas is relegated to the first element, rather than the last. Since appending is more common, this seems a better style.In other words, you know you're just gonna end up with this in your code after a few months:
kittyBreeds = ["Himalayan", ,"Bengal", "Siamese", "Cornish Rex", ,"Manx"]
and not only is it now even worse for changing lines (correcting it and adding another will be -1+3 instead of just -1+2, the optimal +1 a distant memory), but it's just plain a mess and probably people don't know why they need to do it.