3 ms·
Yeah this is a huge selling point of YAML. JSON should have comments added to the spec. The other benefit to YAML is human readability, which is usually better
by krferriter 8y ago
Yeah this is a huge selling point of YAML. JSON should have comments added to the spec. The other benefit to YAML is human readability, which is usually better in YAML compared to JSON. A specific glaring example of this is when there are long string-literal snippets inside the document, in YAML this is massively more readable than in JSON.
- hannasanarion 8y agoJSON shouldn't have comments added to the spec, because people shouldn't be trying to read or write JSON. It's an application interchange language, meant to be written and read by machines. YAML is a markup language, meant to be written and read by people. Ever notice how most YAML libraries don't even have a "dump" function?
- krapp 8y ago>It's an application interchange language, meant to be written and read by machines. Not entirely true, JSON is based on Javascript objects, it was meant to be written and read by humans just like Javascript, INI or any other basic serialized data format, or text-based programming language. If JSON were truly never meant to never be viewed or edited by human beings, it would have been published as bytecode.
- heavenlyblue 8y ago>> Ever notice how most YAML libraries don't even have a "dump" function? No. I guess unless you’re using something half-baked, I suppose. Machines need to be able to edit configs either way.
- marcosdumay 8y agoHum... We have a bad historic of success in deciding that this or that stuff is for machine consumption only.
- lstamour 8y ago> JSON should have comments added to the spec. See also ~5 years ago: https://news.ycombinator.com/item?id=7325735 https://news.ycombinator.com/item?id=7325735