3 ms·
Wayyyyy before comments, the one thing I'd want to see JSON support is effing trailing commas.
by ur-whale 2y ago
Wayyyyy before comments, the one thing I'd want to see JSON support is effing trailing commas.
- 3eb7988a1663 2y agoThis one unambiguously seems like a mistake. Is there any steel man argument for why an extra comma should not be acceptable? Save a byte over the network?
- a3w 2y agoEcmascript is changing JS. JSON is old and unchanging. Which is an advantage and a disadvantage.
- kstrauser 2y agoI think that’s literally the only argument for it. And if you use compression, now you have to waste an extra symbol on `”` in addition to `”,`, so even that’s debatable.
- hinkley 2y ago“ is already a symbol, but for formatted JSON it’s more likely to be “,\r and “\r
- kstrauser 2y agoI bet `: “` is more common than a lonely double quote, except at the end of a list of quoted values. Eh, who knows? But I’m skeptical that the omitted comma actually saves any space in common situations.
- nigeltao 2y agoYou might like JWCC, which literally stands for JSON With Commas and Comments. https://nigeltao.github.io/blog/2021/json-with-commas-comments.html https://nigeltao.github.io/blog/2021/json-with-commas-commen...