Comment by stronglikedan
1 year ago
In the kitchen sink example (https://json5.org/), they say:
> "backwardsCompatible": "with JSON",
But in that same example, they have a comment like this:
> // comments
Wouldn't that make it not compatible with JSON?
It's confusing.
From what I understand, it's "backwards-compatible" with JSON because valid JSON is also valid JSON5.
But it's not "forwards-compatible" precisely because of comments etc.
Stating `backwards compatible` at a feature is at best confusing for readers who haven't already bought into JSON5 as "the way".
If people tended to interpret English correctly and not be susceptible to misinterpreting written statements, that would be nice. Reality is a bugger!
How would you suggest they describe that feature
1 reply →
Backwards-compatible means the new thing can handle the old things. Here JSON5 is backwards-compatible with JSON.
Forwards-compatible means the old thing can handle the new things. Here JSON is not forwards-compatible with JSON5.
Your existing JSON < 5 will work with json5, not the other way around
It’s a superset of JSON. I guess they mean it’s backwards compatible in terms of reading existing JSONs?