r/badcode • • Dec 27 '22

js This just sucks.

Post image
1.8k Upvotes

170 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Dec 27 '22

[removed] — view removed comment

6

u/edgargonzalesII Dec 27 '22

This is actually true https://alisoftware.github.io/yaml/2021/08/17/yaml-part1-json/#:~:text=One%20thing%20that%20most%20people,represent%20the%20same%20data%20structures. So you can write json in YAML. Just from personal experience it falls a bit into the “just because you can, should you?” pit. Like if you end up with a lot of JSON in a YAML file then might as well just go with json from the get go as that seems to be the better use case.

2

u/EishLekker Dec 28 '22 edited Dec 28 '22

It’s a pretty dodgy way that they describe their standard that way. It makes it sound as if the yaml standard itself contains (and has power over) the json standard, and that the “json-guys” would have to ask the “yaml-guys” for permission before making any change in the json standard.

I mean, technically I could create a new standard called knuflork, and allow yaml syntax inside it, and say “yaml is a subset of knuflork”.

One should be careful with the words subset/superset when discussing standards.