3 ms·
If every JSON library actively chooses not to implement the JSON spec, that sounds like an issue with JSON to me.
by matja 5y ago
If every JSON library actively chooses not to implement the JSON spec, that sounds like an issue with JSON to me.
- HelloNurse 5y agoMore precisely, an issue with different literal types instead of one like in XML. In XML, every attribute or text fragment is a string, to be POSSIBLY parsed as a string, integer, date etc. according to what applications choose to do (usually according to an explicit schema). In JSON, YAML, etc. there are at least integers, strings and floating point numbers, introducing arbitrary representation choices (1, 1.0, "1", "1.0") and implementation artifacts (e.g. numerical limits).
- matja 5y agoSeparate types is fine, but JSON doesn't specify a minimum range or precision of the number type that a implementation must have, so the number type is unreliable (and string has to be used instead). To handle any number, a JSON library needs to use an arbitrary-precision number type, which no common one does because of the huge performance hit. So, no better than XML really :D