• iggy
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    8 个月前

    No support for comments? Hard pass

    • Voroxpete@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      ·
      8 个月前

      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
        3
        ·
        8 个月前

        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.