News for hackers. Stuff that matters.
Re:No YAML by munificent on Wednesday October 27, 2021 @08:41PM (#29020950)
I strongly believe that if Crockford hadn't refused to add comments to JSON that YAML, TOML, and other generally bad configuration languages wouldn't exist.
Re:No YAML by rossy on Wednesday October 27, 2021 @09:42PM (#29021336)
There are other things that make JSON a bad configuration language with poor human readability and writability. Lack of multi-line strings is a big one. The requirement to put a comma after every array item and object member except the last has made me write more syntax errors in JSON than I've ever written in YAML. Also, JSON is unsuitable for config files with lots of Windows-format paths, since backslash is its escape character.
Re:No YAML by munificent on Thursday October 28, 2021 @12:28PM (#29027905)
All of that's true. But if it had comments, it would still be a better configuration language than YAML and TOML.
Re:No YAML by hollasch on Wednesday October 27, 2021 @09:32PM (#29021270)
He didn't "refuse to add" them. JSON had comments, and then he removed them.
Re:No YAML by thatswrong0 on Thursday October 28, 2021 @12:13AM (#29022297)
Pardon my French but.. wat
Re:No YAML by schwede on Thursday October 28, 2021 @01:09AM (#29022589)
My interpretation is that since json is JavaScript Object Notation, JS objects can clearly have comments so why limit their usage in json?
Re:No YAML by XorNot on Wednesday October 27, 2021 @09:09PM (#29021132)
YAML works better with line-oriented diff'ing systems - i.e. git (though you need to massage it a lot to make it sensible).
Re:No YAML by jhanschoo on Wednesday October 27, 2021 @09:30PM (#29021259)
Json is a fragment of yaml, which means that all valid json documents are valid yaml documents.

Yaml has parts that broaden its use cases, but I'm slightly surprised that json+yaml comments isn't a more widespread thing.

Re:No YAML by alfalfasprout on Wednesday October 27, 2021 @09:47PM (#29021375)
TOML is actually pleasant to use for like 99% of use cases honestly.