I'm surprised in a discussion of when to quote or not quote with YAML the dreaded "yes", "no", "true", "false", "on", and "off" booleans didn't come up.
Quoting the article:
> In YAML, you can write a string without quotes, if it doesn't have a special meaning.
Didn't realise YAML's problems were that extensive, but I have to disagree with the seeming decision to effectively parse everything as strings instead of requiring all strings be quoted.
> Another use case for quotes is when you have a string that would be resolved as a special type. This highly depends on the YAML version and on the Schema in use. Here are some examples where you need quotes:
Is this even a question? I double quote ALL strings. In fact, my C background makes me use " in Python too, even though single quote ' is acceptable. Somehow " feels more __stringy__.
“How many times have your strings needed to convey some speaker’s voice? How many times have your coded strings needed to convey an object’s possession relationship?”
14 comments
[ 3.4 ms ] story [ 44.8 ms ] threadQuoting the article:
> In YAML, you can write a string without quotes, if it doesn't have a special meaning.
Yeah, about that...
What parent refers to, YAML's Norway Problem: https://hitchdev.com/strictyaml/why/implicit-typing-removed/
> Another use case for quotes is when you have a string that would be resolved as a special type. This highly depends on the YAML version and on the Schema in use. Here are some examples where you need quotes:
“How many times have your strings needed to convey some speaker’s voice? How many times have your coded strings needed to convey an object’s possession relationship?”
Apostrophe, 3.
Double quotes, 0.