• dan@upvote.au
    link
    fedilink
    arrow-up
    55
    ·
    1 year ago

    Friendly reminder if you prefer dealing with JSON - YAML is a superset of JSON, so any valid JSON is also valid YAML.

    • magic_lobster_party@kbin.social
      link
      fedilink
      arrow-up
      52
      ·
      1 year ago

      That’s more of a weakness of yaml. There’s so many ways to specify the exact same thing. Not exactly what you need for configuration files maintained by multiple people. It easily becomes an big incoherent mess.

      In JSON the default way is the only way. Nice and coherent.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        30
        ·
        edit-2
        1 year ago

        I agree that YAML is painful and it really seems like it’s had a lot of feature creep.

        JSON is painful in its own way too, though. There’s a lot of syntax noise from things like braces, quotation marks, etc, so it’s easy to make a mistake. Regular JSON doesn’t allow trailing commas.

        YAML tried to solve some of that, and did succeed in some ways, but introduced its own issues.

        TOML seems great to me, but maybe it has its own issues. TOML actually has defined data formats for things like dates (both offset and local) and times, which is missing from both JSON and YAML so every app ends up doing it its own way.

        • XTornado@lemmy.ml
          link
          fedilink
          arrow-up
          11
          ·
          1 year ago

          One big thing of JSON I hate is that sometimes is used for config files or similar and it doesn’t supports comments which sucks.

          • rambaroo@lemmy.world
            link
            fedilink
            arrow-up
            7
            ·
            edit-2
            1 year ago

            JSONC does support comments but it wouldn’t be interoperable with anything expecting pure JSON. But still useful for local configs.

    • Terrasque@infosec.pub
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Found out the hard way that no, it’s not… there are a few valid json files that most yaml parsers choke on