.yaml, .toml, etc?

  • @AeroLemming@lemm.ee
    link
    fedilink
    English
    1511 months ago

    Of course it does!

    {
      comment: "This data is super important and it runs the system or something",
      data: ["Some", "stuff", "here"]
    }
    
        • @sfera@beehaw.org
          link
          fedilink
          19 months ago

          Don’t worry, I wouldn’t do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That’s information you can’t add to the code which processes the values.

    • @simonced
      link
      English
      111 months ago

      This is actually pretty genius, why haven’t ever thought of that?

      • @AeroLemming@lemm.ee
        link
        fedilink
        English
        111 months ago

        It’s so easy to use, and you can read the comments from in your program too!

        ^(in case you weren’t just playing along, please never do comments this way)

        • @simonced
          link
          English
          111 months ago

          I liked the idea to be honest. I can just call the entry “description” instead and all is good ^^

          • @AeroLemming@lemm.ee
            link
            fedilink
            English
            211 months ago

            Ideally, you would use TOML for human-readable configuration and document your JSON API with external documentation instead of sending comments around a bunch. If you need to display the description to the end user though, that would be a valid use case.