2 ms·
> JSON is simpler to map, faster to parse, simpler, more lightweight JSON is no simpler (nor more complicated) than XML, if you're using a library. It certainl
by chii 3y ago
> JSON is simpler to map, faster to parse, simpler, more lightweight
JSON is no simpler (nor more complicated) than XML, if you're using a library. It certainly isn't faster - a SAX parser is faster than a JSON DOM parser (and JSON streaming parsers equivalent to SAX is rare).
> It has replaced XML as the standard data interchange format for a reason.
the reason isn't technical. It's competency (or lack thereof). Most interchange formats are for websites in browsers, where JSON performs well, since there's no native way to parse XML in the browser. So that mindshare from the web has leaked out to other arenas.
- Ygg2 3y agoThat's crazy talk. JSON is very simple. The irreducible complexity of JSON is lower than irreducible complexity of XML, and irreducible complexity of XML is lower than YAML.
- wokkel 3y agoJson is simple, but the common idiom is to read it al at once into memory and forget the difficult stuff (which encoding is this json in anyway). Then don't do the other difficult stuff (is this a string or a date type)... so it's faster (maybe) to parse but it doesn't scale for large datasets and your application will need additional deserialization logic. A broad sweeping performance statement like this is just spreading fud.
- vaylian 3y agoJSON is hardly very simple given that is a subset of JavaScript. There's also problems with different behaviors of JSON parsers: https://portswigger.net/daily-swig/research-how-json-parsers-can-create-security-risks-when-it-comes-to-interoperability https://portswigger.net/daily-swig/research-how-json-parsers...
- Ygg2 3y agoConsider that YAML is superset of JSON. Then realize any Yaml parser suffers from JSON faults+ YAML unique faults.