• Semperverus@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    12 hours ago

    I wish we would all start switching over to JSON for configuration files. It’s so much easier to parse, and you can’t screw it up with too many spaces or not enough.

    • Voroxpete@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      5 hours ago

      Instead you can screw it up by having too many commas or not enough. Hardly that much of an improvement.

      • Voroxpete@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        5 hours ago

        Yeah, this is my biggest annoyance with JSON. As a data structure it’s very elegant, but it only really makes sense to people who know how to code, and without the ability to add comments you have to rely heavily on external documentation to make it readable to most users.

        • cravl@slrpnk.net
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          And like yeah, both the wonderful (and foss!) .json5 and Microsoft’s semi-proprietary(?) .jsonc exist, but most projects just use their language’s default JSON parser that doesn’t recognize them. What I would personally love to see is .json5 support baked into the default JSON parsing libraries of Python, Go, etc. (Enabled by a flag, likely.) It’s a superset of regular JSON and fully ES2019 compatible, so there shouldn’t be any issues.

    • FooBarrington@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 hours ago

      It’s IMO also so much clearer regarding data types. You can’t accidentally write a boolean when you want a string.