In my app I use multiple Google APIs, and in the documentation of all of them it gives me two options:
- JSON (Recommended)
- XML
Now, when sending requests and retrieving responses why is JSON better? Xcode has a native built in xml parser, and for JSON you must use a JSON parser like AFNetworking. What makes JSON stand out? Is it more efficient or faster?
JSON is much more efficient than XML, which is larger as a whole than JSON. It is very easy to parse, you can use
NSJSONSerializationand parseNSDatarepresentations of JSON in a matter of 2 lines and milliseconds, just shows that it consumes less memory.JSON stands for JavaScript Object Notation, which is NOT like Java, JavaScript to Java is like ham to hamster. Many people make that mistake.