Let the apologists have a field day in the comments.

      • paequ2@lemmy.today
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        14 days ago

        Yeah, I’ve definitely grown to like TOML, especially after spending hours trying to edit a giant (nested) YAML file…

        I didn’t realize the indentation in TOML was purely aesthetic.

        This

        [servers]
          [servers.alpha]
          ip = "10.0.0.1"
          dc = "eqdc10"
        
          [servers.beta]
          ip = "10.0.0.2"
          dc = "eqdc10"
        

        equals this

        [servers]
        [servers.alpha]
        ip = "10.0.0.1"
        dc = "eqdc10"
        
        [servers.beta]
        ip = "10.0.0.2"
        dc = "eqdc10"
        

        which equals this

        {
          "servers": {
            "alpha": {
              "ip": "10.0.0.1",
              "dc": "eqdc10"
            },
            "beta": {
              "ip": "10.0.0.2",
              "dc": "eqdc10"
            }
          }
        }
        
        • Fushuan [he/him]@lemm.ee
          link
          fedilink
          English
          arrow-up
          0
          ·
          14 days ago

          Once the file is big enough wouldn’t it be better to convert it to json before editing, then converting it back?

          Let the computer deal with indents and all that stuff.

          • Ephera@lemmy.ml
            link
            fedilink
            English
            arrow-up
            0
            ·
            14 days ago

            I love this comment. JSON is by far the format that cares the least about being human-readable or -writable, but you’re seriously proposing writing it rather than YAML. And I kind of don’t even really disagree. But a big problem with that strategy is that you won’t find documentation for how to write the configuration in JSON.

            • Fushuan [he/him]@lemm.ee
              link
              fedilink
              English
              arrow-up
              0
              ·
              edit-2
              14 days ago

              I disagree that json is not human writable. JSON is perfectly writable since it has explicit visible separations between elements.

              It might look ugly but it’s perfectly readable and writeable.

              Granted, I always read json after parsing it with an auto formatter. Maybe that’s why people say that json is difficult to read? It’s true that unformatted json (minified) is way worse than yaml but no one in their right mind would not format the json, specially when it’s natively supported by most code editors.

              BTW, about documentation, post formatting json looks very much like a yaml, all yaml docs can be converted to json instructions if you think a little bit.