logoalt Hacker News

mystifyingpoitoday at 7:41 AM2 repliesview on HN

> less human-readable version of JSON

Please provide an example, how YAML can be less readable than JSON. I struggle to think of any.


Replies

voidUpdatetoday at 7:55 AM

Indentation based structure isn't really a good thing in my eyes, where the format of the document encodes semantic meaning. With JSON, you can display it how you want, and because it's bracketed it will still encode the same data.

Also I really don't like the hyphen notation... This is very unreadable to me:

  - a
  - b: c
  - - d
embedding-shapetoday at 10:37 AM

YAML:

  - - "hello"
YAML expanded:

  -
    - "hello"
JSON (typical formatting):

  [
    [
      "hello"
    ]
  ]
And EDN for good measure:

  [["hello"]]
I know which one I prefer :) Silly example perhaps, but once you have X lists nested in Y lists, it does become a lot easier to see why some prefer a bit more visually hierarchically stronger syntaxes
show 1 reply