News for hackers. Stuff that matters.
Re:YAML: Probably not so great after all by zzo38computer on Sunday August 18, 2019 @09:12PM (#20734115)
I don't aversion to braces. Rather, my issues with JSON is that it doesn't have comments and that you cannot use a optional trailing comma.
Re:YAML: Probably not so great after all by EamonnMR on Sunday August 18, 2019 @09:24PM (#20734165)
Having spent a nontrivial amount of my life hand editing large JSON files now, I have to agree here. Lack of comments and trailing commas are a real QOL issue.
Re:YAML: Probably not so great after all by thiht on Monday August 19, 2019 @09:30AM (#20737549)
Also no multiline strings. Using \n or string arrays is painful.

I don't get why TOML is so underrated, it's barely mentioned in the HN discussion

Re:YAML: Probably not so great after all by gpvos on Monday August 19, 2019 @11:25AM (#20738562)
Thanks for mentioning it; I hadn't encountered it yet and it seems like a very sane config file format. There's several mentions in this discussion actually, nearly all positive.
Re:YAML: Probably not so great after all by JoBrad on Sunday August 18, 2019 @10:17PM (#20734381)
And the required double quotes around strings. YAML’s string handling is a lot easier to deal with.
Re:YAML: Probably not so great after all by zzo38computer on Monday August 19, 2019 @11:33AM (#20738648)
I think it is good to require quotation marks for strings, at least for values (although I could live with it if quotation marks for strings are allowed even if not required, since then, if you do not like the feature of not having quotation marks for strings, you can just not use that feature).

Maybe it would be sense if quotation marks were not required for keys with only a restricted character set which are not an empty string, though.

Re:YAML: Probably not so great after all by JoBrad on Wednesday August 21, 2019 @10:34AM (#20757590)
No quotes around keys would be sufficient, honestly. I use YAML a lot for API documentation, and there are still some cases where wrapping your values in quotes is necessary. But requiring it for keys becomes very annoying.
Re:YAML: Probably not so great after all by jtdev on Sunday August 18, 2019 @10:52PM (#20734512)
It’s also a lot less obvious. What’s so difficult about wrapping a string in double quotes?
Re:YAML: Probably not so great after all by h1d on Sunday August 18, 2019 @11:02PM (#20734560)
It gets annoying when you have to do what seems unnecessary.
Re:YAML: Probably not so great after all by Griffinsauce on Monday August 19, 2019 @02:39AM (#20735435)
It's not really unnecessary when someone can write an entire article on how unfathomable the output is without them.
Re:YAML: Probably not so great after all by acdha on Monday August 19, 2019 @06:29AM (#20736533)
It’s easier until you hit one of the cases where a particular value is interpreted as a different type, possibly in a very confusing context. I’ve seen that bite enough people that I end up quoting strings to avoid confusion.
Re:YAML: Probably not so great after all by heavenlyblue on Monday August 19, 2019 @09:32AM (#20737561)
It’s also extremely hard to learn as a beginner.

“Hey, I deleted a character in a string and now I am getting this weird schema validation exception”.

Re:YAML: Probably not so great after all by acdha on Monday August 19, 2019 @10:04AM (#20737818)
Or “Why did it break when I changed the version from 3.7 to 3.7.1?”
Re:YAML: Probably not so great after all by theknarf on Monday August 19, 2019 @06:41AM (#20736597)
Re:YAML: Probably not so great after all by zzo38computer on Sunday August 25, 2019 @12:18PM (#20793762)
JSON5 looks like good, actually. It has all of the added features that it should have.

They don't mention mismatched surrogates and otherwise invalid Unicode characters, but they should perhaps be implementation-dependent, like duplicate keys are. (It can either allow them or report an error.) There is also the possibility that some implementations may wish to disallow "\x00" or "\u0000" too, I think.

The thing I disagree is the part about white space. U+FEFF should be allowed only at the beginning of the document (optionally), and other than that only ASCII white space should be allowed. Unquoted keys also should be limited to ASCII characters.

Other than that, I think it is good.