All very good points, Scott. XML may be more "humanly" readable, but a tool (a JSON browser) could make JSON more humanly readable too. It would make sense to see JSON used for more data interchange between any kind of application, not just between web servers and web browsers.
-Nathan
----- Original Message -----
From: Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Cc:
Sent: Friday, September 20, 2013 12:23 PM
Subject: Re: JSON
Pete,
You're right, JSON started life as a subset of JavaScript, and is widely
used in web applications because JavaScript understands it natively.
However, if you think about it, it's really a better choice than XML for
almost anything:
1) It's less "wordy" than XML. This translates to fewer bytes needing
to be sent over the wire, and a smaller memory footprint to work with.
2) It's structure is simpler than XML -- and that makes it easier to
write/support/maintain JSON parsers, and they tend to run faster, and
have fewer bugs.
3) JSON only supports one text encoding (UTF-8). So unlike XML, there's
no need to try to support every possible encoding under the sun. This
also makes it easier to write/support/maintain JSON parsers vs. XML.
I personally think JSON works better in most applications that folks are
using XML for. There are exceptions... JSON doesn't have an
equivalent of XSD or XSL, so if need that sort of functionality, XML is
still the best choice. But, in most business applications where things
are a simple data interchange, I like JSON.
-SK
On 9/20/2013 1:11 PM, Pete Helgren wrote:
I find that an interesting request because unlike XML, JSON was designed
to be consumed by a browser or server with a JavaScript interpreter.
JSON represents an object in text and when rendered produces an object
for JavaScript to use. Most JSON I have worked with or created has both
data and JavaScript functions so using it to transport data between
non-JavaScript capable servers is an interesting use case.
As an Amazon Associate we earn from qualifying purchases.