3 ms·
>> There are NINE (or 63*, depending how you count) different ways to write multi-line strings in YAML. I hate to be the YAML defender, but I strongly believe
by rossy 5y ago
>> There are NINE (or 63*, depending how you count) different ways to write multi-line strings in YAML.
I hate to be the YAML defender, but I strongly believe that all of YAML's block and flow scalar types are necessary and that YAML's string handling is one of its killer features. Sometimes you need C-style string escaping with "" and sometimes you need verbatim strings with '' (same use-cases as verbatim string literals in programming languages, eg. for regexp.) Sometimes you need collapsed newlines and stripped trailing newlines (writing a description for your blog post in YAML frontmatter) and sometimes you need preserved newlines (embedding other languages like Markdown or Bash in a YAML document.)
A language like YAML should let you represent different types of strings in a way that's still human readable.