by bearjaws · 1y ago · 0 comments
We already have 5+ replacements that are far more robust(XML, YML) and IMO they are not great replacements for JSON.
Why? Because you can't trust most people with anything more complicated than JSON.
I shutter at some of the SOAP / XML I have seen and whenever you enable something more complicated inevitably someone comes up with a "clever" idea that ruins your day.
I don't think that's the primary reason. JSON is pervasive because it started out being trivially parseable by JavaScript going back to when people just evaluated it, even before browsers had ridiculously high-perfomance safe JSON parsers. All the other formats are still harder to work with from JavaScript.
If not for that, personally I'd advocate TOML, which is incredibly simple.
Comments and all, ironically.
I mean sure, "and all" would frequently include script injections etc, but you can't argue it wasn't more feature rich!
1. Comments 2. Trailing commas
We don't use any other JSON5 features, which are primarily just that numbers may be encoded in hexadecimal and field names may have quotes elided.
We typically encode values with RFC 4648 base 64 URI canonical with padding truncated (b64ut) with values too large to be a JSON number, so hex isn't useful anyway. We haven't found that omitting field name quotes is a big deal.
is yaml robust: noExtra hint:
scandinavian countries:
- dk
- no
- se
Edit: it's extremely unlikely a yaml parser implements that spec; the spec is irrelevant.Your claim of "No, it wouldn't" is simply wrong. They said "since 1.2" and you can't just ignore that when you're citing a 1.1 problem. The disclaimer that you edited in gets at a relevant point but it's not strong enough to make your claim actually be true.
And the winky face and the "hint" just make things worse, since they knew exactly what you meant.