Why YAML instead of JSON?
I'm curious about the plan to use YAML rather than JSON. There are a couple of major reasons why I think we should consider switching this to JSON:
- All our other data sources are JSON
- A large percentage, if not an outright majority, of our consumers will be JavaScript code
- JSON is very familiar to web developers; more so, I suspect, than YAML
I know many people feel that YAML is easier to read; I'm on the fence about that. I see that it's got less "stuff" going on in it, but on the other hand, JSON's groupings hierarchically are clearer, IMO, because of the braces.
We should consider this carefully before we go too far along, since this decision is a pretty critical one to get right at the outset.
You're forgetting something; Yaml allows comments. Not only is this super useful to inject some English explanations and justifications, but it also allows to comment things out. I'm in favor of Yaml despite the many subtle advantages of JSON.
We could of course adopt JSON 5, which allows for comments, among other improvements. With that in place, I don't see what advantages of YAML are enough to overcome the substantial advantages of using JSON, given that the interpreters of the code are going to be JavaScript code, probably the majority of the time.
With JSON 5 you still need to pull out a custom parser so you still wouldn't be able to use the built-in JSON.parse (as far as I know).
Yaml has other neat features too such as macro expansion.
For what it's worth, I don't think there's been any discussion of providing YAML to stumptown consumers (e.g., we'd export JSON or provide a node package like BCD).
Also, a fun fact about YAML: it's sort of a superset of JSON (in what it represents, rather than syntax). From time to time, I've converted JSON to YAML, changed it, and converted back, so I didn't have to fight with braces and trailing commas. As long as you don't use the more obnoxious features of YAML, you can round-trip YAML and JSON without losing anything. So we're not really locked into it.
I don't really feel strongly about this either way, but maybe there are important reasons I don't understand. I do agree that consistency with other data sources is a plus, but also I really like the compactness of YAML. I hope that experience working with it will help teach us whether we like it enough to keep it or not.
since this decision is a pretty critical one to get right at the outset.
I don't really agree with this though: I think it would not be that hard to change this as long as we don't have a ton of content migrated. Well before we get to that point, we ought to have better-grounded feelings about it.