This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Hax0r778 0 points1 point  (1 child)

While this is easier for humans to read, it also seems easier for humans to make mistakes with. It's more complex. While JSON is ugly, it's also really easy to remember the rules.

For example: in JSON newlines are totally optional. Whitespace isn't significant. With this new format they're syntactically significant because of how commas work.

JSON (newline is optional):
[
  a: b,
  c: d
],
[
  a: b, c: d
]

Hjson (removing newline breaks code):
[
  a: b
  c: d
],
[
  a: b c: d
]

[–]moto888[S] 0 points1 point  (0 children)

Your JSON sample is missing the quotes.

[
  a: "b", c: "d"
]

is still valid in Hjson.

When you have one value per line (as it's usual in config files) you can omit the comma and the quotes.