2 ms·
And how is it different from, let us say, the current's sweetheart, JSON? (The comparison is not exclusive to JSON, though.) JavsScript Object Notation makes a
by guiraldelli 6y ago
And how is it different from, let us say, the current's sweetheart, JSON? (The comparison is not exclusive to JSON, though.)
JavsScript Object Notation makes a lot of sense to describe... The JavaScript objects.
But, nowadays, I see it universally applied.
As a recent personal experience, I had to use it to serialise communication between a C++ and a Java application---two statically typed languages, with basic types similar among each other but different from JavaScript.
To set the contract between the two applications, I had to write a JSON spec [1], which is written in... JSON. That was an abstruse and abusive use of JSON, in my opinion.
Then comes `jq` and its own notation, in which I suffer to do the basics of a simple XPath---e.g., return all the objects of a certain kind (i.e., a tag) in any level you find it.
Abuse happens [2] because there is a human behind it, especially under the lens of the adage "if all you have is a hammer, everything looks like a nail".
The problem I see in this discussion is that people either want a "magic tool" that works at all cases, or they want to control the human behind it.
In my experience, it is difficult to get both: generality does not play well with constraint.
---
<digression>
I think most people just need to use a plain-text format [4] for most of the things they want, à lá RFC 822 [5].
</digression>
---
[1]: http://json-schema.org/ http://json-schema.org/
[2]: I believe this is a Fibonacci series: https://www.xorpd.net/pages/xchg_rax/snip_01.html https://www.xorpd.net/pages/xchg_rax/snip_01.html
[3]: http://blog.aerojockey.com/post/iocccsim http://blog.aerojockey.com/post/iocccsim
[4]: https://www.arp242.net/the-art-of-unix-programming/#id2907428 https://www.arp242.net/the-art-of-unix-programming/#id290742...
[5]: https://tools.ietf.org/html/rfc822 https://tools.ietf.org/html/rfc822
- kanox 6y ago> To set the contract between the two applications, I had to write a JSON spec [1], which is written in... JSON. That was an abstruse and abusive use of JSON, in my opinion. The XML equivalent is an XML schema, also written in XML. This is pretty decent as document validation goes. > I think most people just need to use a plain-text format [4] for most of the things they want, à lá RFC 822 [5]. You linked to formats which don't even support nesting. If you roll your own markup it's going to be brittle and people are going to parse it with regexps.