3 ms·
I found that json-ld, json-hal and other "describe your json" standards were needed to make json human readable-ish. I hate that there are many competing standa
by a3w 4y ago
I found that json-ld, json-hal and other "describe your json" standards were needed to make json human readable-ish. I hate that there are many competing standards and the link syntax feels clumsy.
JSON5 for "add comments, allow ES6 features" was perfect for private and in a small team use for a while.
No one seems to listen to the JSON inventor, who said he regrets creating a misnomer name and no successor should use the same naming parts, since it neither dependent on or compatible with JavaScript, nor was it only useful for storing and/or describing objects. (I am paraphrasing from my memory on his reasoning on both points.)
Open API 3 solved that problem for me, transforming JSON-RPC into a documentented API.
- root_axis 4y agoJSON is syntactically valid JavaScript, why do you say it's not compatible with JavaScript?
- krainboltgreene 4y agoNot all JSON is syntactically valid javascript.
- alexisbear 4y agoSince ES2019[1], all JSON is valid JavaScript with U+2028 and U+2029 being accepted as unescaped characters in strings. 1: https://tc39.es/proposal-json-superset/ https://tc39.es/proposal-json-superset/
- WickyNilliams 4y agoJSON is not a strict subset of JS in that `true` is valid JSON, but not a valid JS program. Might be considered a nitpick but in a thread about semantics it's worth noting
- a3w 4y agoAsk Douglas Crockford. I did not find my source on his apprehension of his name. What id did find: He states that he did plan for JSON to be a JavaScript subset, which contradicts his later finding, for which I have only me memory as a source, that JSON is not in some sense JavaScript. More on topic, I did find a source that it was never meant to be human-readable in the sense of usable for documentation, but a machine-communication language, therefore comments were removed from the initial draft to avoid having non-standard meanings put in the freedom comments allow (think pre-process directives etc.).