
Lessons of JSON - bpierre
http://inkdroid.org/journal/2012/04/30/lessons-of-json/
======
olavk
KISS is not a magic formula, though. The precursor to SOAP was XML-RPC which
is very simple. So simple it didn't allow time zones in datetimes, and didn't
support characters beyond ASCII in strings. There was no way to extend XML-RPC
to support unicode or unambigous datetimes. This basically killed XML-RPC for
most of the world. JSON already have problems because there is no datetime
format. People need datetimes, so several incompatible hacks have been
designed to represent datetimes as strings. There is no way to extend JSON to
support proper datetimes.

The complexities in SOAP are there because someone need it. Someone already
have invented a schema language for JSON: <http://json-schema.org/>. If every
feature from the SOAP stack is reinvented for JSON, JSON will end up as
complex as SOAP. Then someone else will surely invent yet a new standard (web-
sexprs?) and claim it saves us from the needless complexity of the JSON-stack.

The bottom line: Some systems have simple needs, some systems have complex
needs. Making a format layered and extensible (like the SOAP-stack) introduces
additional complexity. But a non-extensible format requires complex hacks if
your needs grows beyond what the format were design for. There is no perfect
one-size-fits-all data format.

~~~
pixelcort
The other limitation of JSON is there doesn't appear to be a standard way of
representing Unicode code points above 16 bits (such as some Emoji) in
strings. One way I've seen it done is to put two escaped UTF-16 surrogate
pairs together; another way I've seen it done is having the UTF-8 literal
inside the string.

~~~
sopooneo
Please forgive my ignorance, but why not? Couldn't the entire JSON response
be, for instance, UTF-8 encoded, thus allowing the representation of all
possible Unicode code points?

~~~
pjscott
Yes. In fact, JSON documents _must_ be Unicode text, and the default encoding
is UTF-8.

------
6ren
> Rather than claiming he invented JSON he instead says he discovered
> it–almost as if he was a naturalist on an expedition in some uncharted
> territory.

JSON is part of javascript (it's even right there in the name). Far from
uncharted territory, javascript was a deliberate human creation. His
contribution was to extract that specific part, and apply it to another
problem.

------
telent
The lack of a timestap datatype is a problem, but the lack of a 'link'
datatype is imo a greater one, now that people are doing supposedly-RESTful
APIs with JSON payload. Which is not to say that you can't layer that type
info on top of JSON (see e.g. HAL) but you do need both ends to agree that
that's what you're doing otherwise it kind of treads on the "no out-of-band
info" property

------
nolok
JSON and SOAP, the two PR guys for KISS

~~~
jerf
I assume by that you mean that SOAP is a PR guy for KISS by virtue of showing
what happens when you don't?

~~~
nolok
Yes

