← Back to context

Comment by merelysounds

4 hours ago

This is a reference to YAML parsing the two letter ISO country code for Norway:

    country: no

As equivalent to a boolean falsy value:

    country: false

It is a relatively common source of problems. One solution is to escape the value:

    country: “no”

More context: https://www.bram.us/2022/01/11/yaml-the-norway-problem/

We stopped having this problem over ten years ago when spec 1.1 was implemented. Why are people still harking on about it?

  • Because there's a metric ton of software out there that was built once upon a time and then that bit was never updated. I've seen this issue out in the wild across more industries than I can count.

    • I’m not here clanking down on Java for lacking Lambda features, the problem is that I did not update my Java environment past the 2014 version, not a problem with Java.

  • Now add brackets and end-tags, I'll reconsider. ;)

    • Brackets works fine:

          Roles: [editor, product_manager]
      

      End tags, that I’m not sure what that is. But three dashes is part of the spec to delineate sections:

          something:
              setting: true
          ---
          another:
              thing: false

  • Because once a technology develops a reputation for having a problem it's practically impossible to rehabilitate it.