←back to thread

Fixing JSON

(www.tbray.org)
139 points robin_reala | 4 comments | | HN request time: 0.209s | source
1. emilsedgh ◴[] No.12327758[source]
Ma­jor ir­ri­tan­t: Com­mas

I thought the major irritant was having to add double-quotes around keys? Commas never bothered me personally, but having to use double quotes is actually irritating.

replies(3): >>12327800 #>>12327816 #>>12327978 #
2. smcl ◴[] No.12327800[source]
I was thinking the same thing - maybe I haven't hand-edited enough JSON but I have never felt like commas were any sort of issue at all
3. espadrine ◴[] No.12327816[source]
It comes from the flow of edition: remove the last element of a list (which typically is on its own line), forget about the fact that there is a comma at the end of the previous line.

But both optional commas and optional double-quotes are provided by Hjson <https://hjson.org/>. They do not advocate its use in protocols, however.

4. oxplot ◴[] No.12327978[source]
Inability to add trailing commas creates two problems:

- You can forget to drop/add comma when copying an existing line - Adding/Removing last element shows up as two changes in diff