Live data from Hacker News

Why is JSON so popular? Developers want out of the syntax business

blog.mongolab.com

71–80 of 133 posts

Re: Why is JSON so popular? Developers want out of the syntax business

#72
post #64
post #51

JSON is so popular because it's data description abilities are poorer than that of XMLs. Everything in JSON can be easily mapped to a few basic types in any popular language, and so all the JSON writers/readers do exactly that. The consequence is that it's very easy to work with JSON. Contrast with XML, which has node attributes and children, to start with. This alone is sufficient to make it not as naturally represe…

JSON is an example of 'worse is better'.

No, in my opinion it is an example of "good enough".

Re: Why is JSON so popular? Developers want out of the syntax business

#73
post #27

The baby that has been thrown out with the bathwater here is a schema/data description layer. NOT , I repeat NOT , I repeat NOT for verification but rather for tools, so that people working in strongly typed languages can interact with JSON services in a reasonable manner. Unfortunately the one option I see, JSON Schema, appears to have caught the XML/Java bug, and has gotten very complicated.

JSON-schema, if you really need it http://tools.ietf.org/html/draft-zyp-json-schema-03

I haven't been able to find any solid, broad implementations of anything that brings schemas to json - either this ietf standard or something else. Only some half-assed and not developed for years implementations for a single programming language. Are there implementation of the spec you link to?

Re: Why is JSON so popular? Developers want out of the syntax business

#74

The best way I've encountered to construct XML: first-name John last-name Smith I kid you not. That's what I'm dealing with at work right now. Thank you, enterprise SOAP solutions.

Are you really having to deal with the SOAP protocol yourself? I mean, their are libraries that handle all this for you. Just read in the WSDL, and call the methods as you need them. No need to muck around with XML.

Re: Why is JSON so popular? Developers want out of the syntax business

#75
post #59
post #7

Ironically, php provides a way to access XML data almost as easily as JASON data - SimpleXML. Do other languages/frameworks really have nothing similar?

Only problem with SimpleXML is that it needs to have the complete file in memory. This isn't a problem for small XML files. But reading a file of lets say 100MB will produce tons of objects an thus a large amount of used memory.

I'd argue that any chance of having a large XML file where you'd use SAX, you'd need to deal with JSON in the same manner. Then the problem is solved with XML (use SAX), but with JSON, what do I use?

Re: Why is JSON so popular? Developers want out of the syntax business

#76
JSON is popular because:

JSON can be consumed by JavaScript. This makes pushing JSON rules easy. I can create an API once in JSON. Now, someone can create a web app and make API calls with JavaScript.

That's the reason it's popular.

Another, smaller reason, is:

Many languages/libraries/frameworks provide poor XML support. If your hand coding your XML-RPC/SOAP calls, or dealing with your average XML in a way different then you would JSON, I really don't know what to say other than: Why?

All the other reasons: verbosity, confusion over XML, etc. All those are okay, I guess, but aren't good reasons.

If JSON couldn't be parsed by JavaScript, it wouldn't be used.

Re: Why is JSON so popular? Developers want out of the syntax business

#77

The mostly-just-one-way-to-organize-it approach cannot be overstated here. XPath is neat, but iterating through parser results is still a pain.

That because XML does not map well to Simula style OO. "Iterating" XML in XSLT (a language designed to manipulate XML) is way less of a pain.

You've got to be kidding. I see the usefulness of XSLT, but still XSLT is a synonym to pain. Definitely one of the most ugly syntaxes I've ever.

It has a place, it can be useful, but I thoroughly detest it.

Re: Why is JSON so popular? Developers want out of the syntax business

#78

The best way I've encountered to construct XML: first-name John last-name Smith I kid you not. That's what I'm dealing with at work right now. Thank you, enterprise SOAP solutions.

You should check out the format iTunes uses for its music database. It's just as bad as this.

Re: Why is JSON so popular? Developers want out of the syntax business

#79
post #64
post #51

JSON is so popular because it's data description abilities are poorer than that of XMLs. Everything in JSON can be easily mapped to a few basic types in any popular language, and so all the JSON writers/readers do exactly that. The consequence is that it's very easy to work with JSON. Contrast with XML, which has node attributes and children, to start with. This alone is sufficient to make it not as naturally represe…

JSON is an example of 'worse is better'.

You mean "less is more".
Post reply on HN