←back to thread

Fixing JSON

(www.tbray.org)
139 points robin_reala | 1 comments | | HN request time: 0.271s | source
Show context
greenyoda ◴[] No.12327716[source]
I never understood why the double quotes around property names are mandatory. For example, in JavaScript, I can write

    { foo: 1, bar: 2 }
but JSON syntax insists on

    { "foo": 1, "bar": 2 }
This makes JSON less easily readable by humans, and harder to write or edit by hand.

Anyone know why JSON was designed this way?

replies(6): >>12327762 #>>12327775 #>>12327805 #>>12327829 #>>12327836 #>>12327945 #
1. Feneric ◴[] No.12327805[source]
The stricter syntax allows JSON to be directly parsed outside of JavaScript in other languages like Python. This is a nice feature and one of the selling points of JSON.