[erlang-questions] No JSON/MAPS interoperability in 17.0?
Loïc Hoguin
essen@REDACTED
Fri Mar 14 02:08:42 CET 2014
On 03/13/2014 09:16 PM, Carsten Bormann wrote:
> On 10 Mar 2014, at 15:54, Loïc Hoguin <essen@REDACTED> wrote:
>
>> Could you elaborate on what the dominant usage of JSON is?
>
> Certainly.
>
> JSON is used for data interchange between applications or within components of an application.
It's a terrible format for doing the above.
* It's text-based, meaning it's incredibly slow to parse.
* It has to be valid UTF-8, meaning it's incredibly slow to validate.
* Its numbers representation is double-precision floating-point,
meaning it's incredibly imprecise and limited.
These are the three main reasons why I avoid JSON. There are numerous
others I'm sure. I'm sure everyone has heard horror stories.
Side note: I do not understand how so many programmers can identify
themselves as pro-environment and then waste so much energy and
resources by parsing these ridiculously bad formats and protocols. Stop
using JSON, save the planet!
Another criticism I have for it with regards to the Web specifically is
the lack of hypertext, which in turn makes it harder to design a proper
REST service. Most APIs seem to decide on a convention for identifying
links (like <prefix>_link keys), and that convention must also be
hardcoded into clients that use it, and isn't common to all services.
That's pretty bad. You still can be RESTful, but only with the help of
something heavy like RSDL, which is probably worse than just not being
RESTful.
I do not have a magical format to propose to replace it (I tend to go
with msgpack, but it also has its issues, though not as many as JSON)
but perhaps I should work on it soon in preparation for my EUC talk.
I'm on the edge of off-topic there, so I'll stop this comment there.
--
Loïc Hoguin
http://ninenines.eu
More information about the erlang-questions
mailing list