3 ms·
My observation of the rise of JSON/HTTP was that it was a thing happening in the dynamic language communities, and that only came into the Java world when the b
by twic 12y ago
My observation of the rise of JSON/HTTP was that it was a thing happening in the dynamic language communities, and that only came into the Java world when the battle was already over.
I suspect the dynamic language communities preferred JSON/HTTP so strongly because it was so much easier to use: they didn't have big corporate backers releasing SOAP tooling, but it's trivial to parse JSON straight into structures that are more or less native to the language (arrays of objects in JavaScript, lists of dicts in Python, arrays of hashes in Ruby).
Java did have heavy-duty SOAP tooling, and didn't (and doesn't) have a natural way to represent JSON's objects, so it was much less of a win there.
- hayksaakian 12y agoNot sure what you mean. What about https://github.com/douglascrockford/JSON-java https://github.com/douglascrockford/JSON-java ?
- twic 12y agoGiven the JSON string: {"cities": [{"name": "London"}, {"name": "New York"}]} Parsed into a variable called 'root' with either 'new JSONObject(...)' or 'json.loads(...)', compare: root.getJSONArray("cities").getJSONObject(0).getString("name"); To: root['cities'][0]['name'] The Python version is the sort of thing you find yourself writing in Python anyway (at least, if you write tabloid-level Python the way i do); it's reasonably idiomatic. The Java version is cumbersome and feels very un-Javaish. Bear in mind that with SOAP, in Java, by that point you would have mangled the data into realistic-looking objects, and would write something like: root.getCities().get(0).getName();