3 ms·
> You need to process the entire document before you can (de)serialize Really? How so? What does JSON do so differently to what seems to be a much more comple
by necovek 2y ago
> You need to process the entire document before you can (de)serialize
Really? How so?
What does JSON do so differently to what seems to be a much more complex format of XML which has streaming parsers (eg. libxml2 push parser perusing SAX callbacks)?
Without thinking hard, a parsed JSON document is easy to parse and serialize back up to any point you got the data for.
I am guessing what you mean is that you can't easily read from the middle (you'd have to parse both backwards and forwards), but for any tree like structure, I don't see how you can avoid that (eg. CSV can't encode hierarchical structures).
I do agree on point 2: low amount of native data formats really does such (I'd add date-time/timestamp to the list too).