4 ms·
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.
by munificent 5y ago
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.
- jhanschoo 5y agoJson 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.
- deleted 5y ago[deleted]
- XorNot 5y agoYAML works better with line-oriented diff'ing systems - i.e. git (though you need to massage it a lot to make it sensible).
- hollasch 5y agoHe didn't "refuse to add" them. JSON had comments, and then he removed them.
- thatswrong0 5y agoPardon my French but.. wat
- schwede 5y agoMy interpretation is that since json is JavaScript Object Notation, JS objects can clearly have comments so why limit their usage in json?
- rossy 5y agoThere 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.
- munificent 5y agoAll of that's true. But if it had comments, it would still be a better configuration language than YAML and TOML.
- alfalfasprout 5y agoTOML is actually pleasant to use for like 99% of use cases honestly.