4 ms·
As much as i like this (yaml goes way too far, but trailing commas and comments would make json much nicer. I actually think this spec goes too far with single
by bawolff 2y ago
As much as i like this (yaml goes way too far, but trailing commas and comments would make json much nicer. I actually think this spec goes too far with single quotes) i hate that it is named json5. I think its unethical to imply you are the next version of something if you don't have the blessing of the original author.
- j1elo 2y agoI always thought that the name JSON5 pretends to be nothing more than a pun on Michael Jackson's original band, The Jackson 5. It sounds too similar! If it didn't originate from that, what else?
- bawolff 2y agoThe project description describes it as json plus syntax from emcascript 5.1 (commonly called ES5) [the official name of javascript is emcascript]. I imagine that is where the name comes from. Although it doesn't really make sense since most of the stuff they add predates ES5.
- Zamicol 2y agoYes, that is where the name comes from.
- zeven7 2y agoI assumed it was a play on HTML5 ¯\_(ツ)_/¯
- dcre 2y agoHa. There is no way that’s what it means unless you read that somewhere.
- benkaiser 2y agoI agree with the others that ES5 is likely where it came from, but my mind also jumped to The Jackson 5.
- Dylan16807 2y agoEven when the original author said it was "discovered"? JSON5 is closer to "javascript object notation" than JSON itself. It's partly an update and partly a removal of arbitrary restrictions.
- yosito 2y agoExcept that JSON is a valid JavaScript object, and JSON5 is not.
- Zamicol 2y agoWhy is it not? My understanding is that it is a valid ES5 and forward object.
- ahartmetz 2y agoUnless there's a direct lie in the description of JSON5 ("subset of ECMAScript"), JSON5 objects are valid JS objects.
- tubthumper8 2y agoCan you provide an example?
- papa-whisky 2y agoI think the name just means that it sits in-between JSON and ES5 (i.e., it's a superset of JSON and subset of ES5). edit: well as this comment thread indicates, the name is pretty confusing for everyone :)
- yonran 2y agoThe parser for tsconfig.json (typscript.parseConfigFileTextToJson(fileName, jsonText) or parseJsonText) seems to be what you want; I wonder if there is a name for that format.
- bobbylarrybobby 2y agoI think JSONC is the term for json with comments and trailing commas
- The_Colonel 2y agoSingle quotes are useful for string contents containing many double quotes (e.g. XML).
- bawolff 2y agoLots of things are useful. I think json has been succesful largely because it preferred minimalism over usefulness.
- The_Colonel 2y agoIt's not a binary choice. I don't think if Crockford chose a slightly larger subset of JavaScript for JSON (such as JSON5), it would hurt its adoption.
- wvh 2y agoCould also be construed as paying homage, though. I think the number 5 here is a reference to congruence with ECMA Script 5 rather than to imply a version of JSON.