Re:Why are we templating YAML?
by krferriter on Thursday February 07, 2019 @07:55PM
(#19110286)
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.
[ Parent
| on HN ]
Re:Why are we templating YAML?
by hannasanarion on Thursday February 07, 2019 @09:22PM
(#19110905)
JSON 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?
>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.
Re:Why are we templating YAML?
by heavenlyblue on Thursday February 07, 2019 @11:12PM
(#19111452)
>> 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.
Re:Why are we templating YAML?
by marcosdumay on Friday February 08, 2019 @10:15AM
(#19114923)
Hum... We have a bad historic of success in deciding that this or that stuff is for machine consumption only.
> JSON should have comments added to the spec.
See also ~5 years ago: https://news.ycombinator.com/item?id=7325735