Also worth looking are EDN [0] (mentioned briefly under S-Expressions), Transit [1] and Fressian [2][3]. [0] https://github.com/edn-format/edn [1] https://github.com/cognitect/transit-format [2] https://github.com/Datomic/fressian/wiki [3] https://www.youtube.com/watch?v=JArZqMqsaB0&ab_channel=Cloju...
Yeah, the author didn’t specify why he thought EDN wasn’t more than “a good start.” I’m curious what it’s missing!
Better Than JSON?
51–60 of 153 posts
Re: Better Than JSON?
#52Edn should be on this list
Re: Better Than JSON?
#53On XML: > Not sure anyone really knows how XML happened. It’s > basically the W3C’s fault, I think? It’s okay for some > things but in the end I’m not sure it’s something anyone > actually wants to use, it’s just going to be one more of > those mistakes of the past. Look, I was doing web dev when XMLRPC was in. For simple API stuff, JSON ended up being worlds better. No fiddly XML preamble, no schemas, no envelopes,…
XML can be a bear, but sometimes you need a bear.
Phrase heard at conferences in the 90's/2000's: "XML is like violence. If it doesn't work, you're not using enough of it."Re: Better Than JSON?
#54On XML: > Not sure anyone really knows how XML happened. It’s > basically the W3C’s fault, I think? It’s okay for some > things but in the end I’m not sure it’s something anyone > actually wants to use, it’s just going to be one more of > those mistakes of the past. Look, I was doing web dev when XMLRPC was in. For simple API stuff, JSON ended up being worlds better. No fiddly XML preamble, no schemas, no envelopes,…
This coming from someone who hates XML, avoids it at nearly all costs - there are times it's the right tool for the job. And you list that time. If you have a 1-1 API contract, don't use XML. If you have 1-N, don't use XML. But if you have N-N API contracts? Where you're talking to half a dozen other services, and they're all talking to you? XML is an excellent choice.
Re: Better Than JSON?
#55The idea of JSON is to offer two important ways to aggregate, which are different enough that they deserve separate treatment - ordered array and associative array. They are economically represented, with [] and {}, and internal structure is also made with small costs - commas (,) between elements and colons (:) for keys in associative array. We can argue that both of those features are required.
Chosen primitives - numbers, strings, booleans and null - are also selected from what's regularly and consistently used, and the choice is supported by two decades of JSON application. Roots of this selection are in design of JavaScript, which in turn relied on common practice for basic primitives.
If JSON is considered as what I think it is, structure out of basic primitives, it's at the optimal point. Crockford's decision to avoid JSON versioning makes a good sense.
Applications of JSON - human-readable texts, performance-optimized communications - can suffer from e.g. lack of built-in comments, non-extensible "type system", non-optimal bandwidth usage (if direct ASCII or even UTF-8 is used for JSON encoding, not some other compressed approach). They however can be fixed by building on top of JSON. For example, parties can agree upon reserved keys and compression schemas, constraints in form of grammars (JSON-Schema). This flexibility stems from the fact that JSON is at the very foundation of data structures, so "better than JSON" is to an extent like "better than two's complement number representation".
Re: Better Than JSON?
#56Also worth looking are EDN [0] (mentioned briefly under S-Expressions), Transit [1] and Fressian [2][3]. [0] https://github.com/edn-format/edn [1] https://github.com/cognitect/transit-format [2] https://github.com/Datomic/fressian/wiki [3] https://www.youtube.com/watch?v=JArZqMqsaB0&ab_channel=Cloju...
Yeah, the author didn’t specify why he thought EDN wasn’t more than “a good start.” I’m curious what it’s missing!
Re: Better Than JSON?
#57Re: Better Than JSON?
#58> Apache is the tragic junkyard of open source projects This made me laugh more than it probably should have.
Re: Better Than JSON?
#59The only problem with json is that you can't do comments with the default implementation.
No trailing commas and multi-line strings are my other two big complaints. The ability to leave keys unquoted if they don't have any spaces would also be nice. The best part is that these are a superset of JSON and could easily be added if there would just be more buy-in (lots of unofficial support already exists).