• Michal@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I like this. I also like yaml, I’ve had very few issues with it and it’s nicer to work with than json.

    Json’s lack of support for trailing commas and comments makes it very annoying for everyday use.

    • backgroundcow@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Just the other day I had a list show up as [“a”, “b”, “c”, “d”, “e”, false, “g”, “h”, “i”].

      The issue was that, without me being overly aware of it, the data was going through a data -> yaml -> data step.

      Yes, the data -> yaml filter was broken for not putting general strings in quotes. But IMO the yaml design invites these odd “rare” bugs.

      I used to like yaml, but was happy to see Toml taking the niche of human-readable-JSON, but felt the format for nested key-value was a weird choice. However, I’ve always felt we could just have extended JSON a bit (allow line breaks, comments, if the outermost data type is an object, the curly brackets may be omitted).

      • Ethan@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Using YAML as an intermediate format between steps of a process is a mistake. I love YAML for configuration but I’d never use it for machine-to-machine anything. If the tool you’re feeding data to requires YAML as input, just give it JSON. All JSON is valid YAML.

        Edit: I realize you weren’t the one who made that decision. I’m saying the problem isn’t YAML, the problem is someone using YAML inappropriately.