4 ms·
I found this headline odd: "Bloated, human readable format that demands extra compression" Is human readability a main reason for using JSON or is it a benefic
by slantyyz 11y ago
I found this headline odd: "Bloated, human readable format that demands extra compression"
Is human readability a main reason for using JSON or is it a beneficial side effect?
I always assumed (rightly? wrongly?) that the reason for using JSON was that it uses Javascript's native object format and therefore much easier to serialize/deserialize and debug at the browser level.
- strictnein 11y agoAnd it makes absolutely no sense when comparing it to the most popular alternative: XML. Talk about bloated.
- nine_k 11y agoHuman-readability means low density: ASCII only uses 7 bit of 8, and most characters, like letters or digits, use only 6. Nobody in their sane mind would `eval()` a JSON received from network, so parsing is required in any case, JS or not. A combination of lists and maps (maps being just a special-form list of pairs) can be represented in a much more compact way, especially numbers. Thrift and Cap'n Proto are definitely more compact and as fast, or faster, to parse. I still suspect that in many cases, HTTP headers can be comparable to the message in size. A high-efficiency protocol would create a connection and avoid re-sending this information with every request — but good luck taking it through certain corporate firewalls.