logoalt Hacker News

sethops112/08/20242 repliesview on HN

May I suggest using TOML, which in my experience has been the perfect blend of human readability while having good tooling.

https://toml.io/en/


Replies

hombre_fatal12/08/2024

Like YAML, it's only better in the simple case where everything is top-level and there's only one level of nesting.

Once you want to have arrays of nested objects or objects with arrays, I immediately wish I was just reading JSON so I knew where I was in the tree.

And for that reason, I don't think it's a full contender. I want an answer for the hard cases like nested data, not just another way to write the simple cases which is what TOML is.

For example,

    [[a.b]]
    x = 1

    [a]
    y = 2
Versus:

    {
      "a": {
        "b": [ { "x": 1 } ],
        "y": 2
      }
    }
It's easy to complain that the latter is noisier. But that's nothing compared to being clear.
show 3 replies
viraptor12/08/2024

Their dictionaries and arrays split into ini-like sections are not very readable though. The double [[ is just nasty and not possible to apply in all situations (array in map in array).

show 1 reply