6 ms·
JSON does have one advantage over XML: it maps cleanly onto primitive types in Python and many other languages. XML attributes don’t really have an unambiguous
by nrclark 3y ago
JSON does have one advantage over XML: it maps cleanly onto primitive types in Python and many other languages. XML attributes don’t really have an unambiguous way to be represented using list and map primitives (other than maybe an “everything is a map” model, which sucks from a usability perspective).
- aforwardslash 3y agoI beg to differ. JSON only provides a subset of commonly available data types (quick example: show me a proper 64 bit int, a proper date type or a proper money type). And "everything is a map" is pretty much how python works, but they prefer to call it dicts. I could go on and explain how JSON is evolving to have exactly all the problems of xml without any of the advantages, and how people keep reinventing the wheel (pun intended for python fans) ignoring why xml is the way it is (and it is quite more robust than anything json). Xml biggest defect was verbosity, specially in a http 1.0 context. With http 1.1 (so nowadays, legacy tech) , most of these problems disappear. I know, parsing of json is quite simple - the reason is the format is lacking.