JSON maps to a small set of nearly universal types and data structures. It is intuitive to write, read and reason about. XML is not.
-
-
-
what are those data types?
-
List, map, number, string, boolean, null. What else do you need? Maps nicely to pretty much every language -- thus massive adoption.
-
map: ordered or unordered? How do you deal with dup keys: { "//": "fake comment", "//": "really exists" }
-
what kind of string?
-
every one of these questions has personally cost me dozens of hours and didn't result in a satisfactory results.
-
DOZENS of hours? You have had to slog through some pretty poor JSON APIs. I can't say I've ever had to even care.
-
I work on frameworks ;)
- 4 more replies
New conversation -
-
-
1. XML has an infoset, and JSON does not. This makes JSON simpler. 2. JSON has dicts, XML has attributes. 3. XML requires encodings.
-
I assume (2) is meant to be a wash?
-
yes, but see 3. No one has to encode attributes in JSON.
-
I think you're cheating quite a bit re JSON. Recall that the JSON spec intentionally elides semantics, therefore no infoset.
-
the semantics of json are charitably the JSON section OF ECMA262 (not small) and in practice lots of encoding/number incompat
-
XML doesn't have number issues because it doesn't have numbers. It's simpler in that respect, but not in syntax or usability.
End of conversation
New conversation -
-
-
graphql = json + types
-
where are the types?
-
refering to graphql type system
-
I don't see any types.
-
do you think my point is valid?
-
I think of GraphQL as more like SQL than JSON but I get what you're getting at.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.