Live data from Hacker News

Better Than JSON?

wiki.alopex.li

61–70 of 153 posts

Re: Better Than JSON?

#61

On 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,…

"Sometimes you eat the bear, and sometimes the bear eats you."

You only need to serialize faster than the guy next to you, or something

Re: Better Than JSON?

#62
post #34
post #6

Everyone loves to hate on XML just because it can be verbose and some of the WS* protocols are complicated. But as a human-readable format it’s no harder to read or parse than JSON and legacy application support is orders of magnitude better than JSON. I’m not saying we should all use it but we shouldn’t be hating it either.

Hmm no, XML is 10x harder to read than JSON, period. It's just a ugly format with so much metadata information which are not human friendly. I think that's the main problem of XML it's not meant to be read by humans but people thought it was.

The primary problem with XML is that it's a document markup language being used to do data serialization. Schemas were bolted on after the fact to add enough metadata for data serialization, but that's a whole lot of added complexity on top of the already complex process of parsing a lightly specced document.

So you have an already complex document parser (which you are using only a fraction of the full functionality!) with the added complexity of a schema system layered on top. This is why JSON took off so fast, it ditched the whole document part and just gave you the data.

Re: Better Than JSON?

#64
post #6

Everyone loves to hate on XML just because it can be verbose and some of the WS* protocols are complicated. But as a human-readable format it’s no harder to read or parse than JSON and legacy application support is orders of magnitude better than JSON. I’m not saying we should all use it but we shouldn’t be hating it either.

Yes, XML is verbose.

It's also highly redundant (so it basically can't be hand written), undesrpecified (do I put this value as an atribute, value, or sub-element?), underpowered (how does it represent numbers? Byte streams?), complicated (have you ever created a DTD by hand?), and just out badly designed.

Of course, JSON and YAML share some of those same problems, and add some different ones. But the complaints about XML aren't some superfluous opinions about how it looks.

Re: Better Than JSON?

#65
post #55

In some sense JSON is unimprovable, because some properties of JSON are reached their limits. The 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…

I think https://github.com/rentzsch/lich gets the basic primitives right as well, and in a binary-friendly format, but it has never been pushed by any organization, so it’s essentially unknown.

Re: Better Than JSON?

#66

> Not sure anyone really knows how XML happened. It’s basically the W3C’s fault, I think? Doesn't instill confidence in that content. fyi: XML was subset by W3C (the SGML "extended review board" specifically) from SGML to become the generic syntax for web vocabularies (replace HTML syntax by XTHML, and define new SVG, MathML vocabularies). Didn't work out on the web, though.

> Doesn't instill confidence in that content. It is pretty clear by the language used that it's all written tongue in cheek.

There's also the joke that nobody wants to take the blame for inventing XML.

Re: Better Than JSON?

#68

The list shouldn't mix those with a schema and those without. Anything using a schema that is agreed upon between participants isn't like JSON at all.

All of them use schemas, the only difference is if the syntax is specified in the language and can be machine verified or if you're left to figure it out on your own. Actually the latter will be machine verified too, but the results of a mismatch is a core dump or an error in your own ad-hoc schema verification system.

Re: Better Than JSON?

#69

On 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,…

One of my very, very, very first jobs (1999) was at a startup that was leaning very heavily into XML for dealing with structured data. A massive amount of time was spent dealing with issues related to hand-editing XML, so I went deep into building schemas, utilities to validate XML according to the schema, and finally building an editor that was capable of providing some XSD-enabled automagic.

Good times.

Re: Better Than JSON?

#70
post #4

There is no such thing and this is blasphemous - shut it down.

It would be nice to be able to represent 64-bit ints--and have comments.

As for comments, I think JSON is only "human readable" by accident. It was never really meant to be read by humans, and was created in a way that implicitly discouraged people from trying to write or edit it by hand. Many parsers are picky about whitespace to discourage people from trying to create config files in JSON.
Post reply on HN