Live data from Hacker News

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

stereolambda.wordpress.com

11–20 of 120 posts

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

#11

There are so many cool things you can do with JSON. I just created a boolean logical statement builder on a web page by using free form open and close parenthesis, and and/or radio buttons. A little regex to change the parenthesis into square brackets, then an eval(), and I can walk the whole statement recursively.

eval() strikes me as a dangerous thing, security-wise.

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

#12

JSON is popular because there is a straightforward mapping from JSON to native types in many programming languages.

Language designers take note: there is tremendous utility in making entities in your language isomorphic to entities expressed in previous languages.

I am actually using such isomorphisms in my current porting project. I'm literally getting a couple of orders of magnitude more productivity out of this over porting by hand.

Also note: less syntax makes this easier.

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

#13
post #9
post #6

Earlier quoted context omitted.

Sorry we were late to the party, guys, we just got so wrapped up in writing software that people actually use.

... while the lispers where still counting the closing parens needed to finally get their code running SCNR

This thread has been yet another fruitful contribution to the language wars.

There seems to be something inherent in us that feels the need to turn our tools into our religion. It's not terribly productive.

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

#14
The argument that XML can have various different structures for storing a person's name, while JSON provides one simple solution, doesn't fly. You could run into something like { "Person": { "property": { "type": "first-name", "value": "John" }, "property": { "type": "last-name", "value": "Smith" } } }

This begs the question, "Why would you do something that convoluted?" Well, you can ask the same of the XML examples, and the answer probably boils down to requirements (or incompetence?).

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

#15
post #9

Earlier quoted context omitted.

... while the lispers where still counting the closing parens needed to finally get their code running SCNR

Only the ones too clueless to use Emacs or another editor that does it for you.

For some reason, every time I let an editor automatically insert a closing parenthesis, quotation, or brace, I almost always end up with extras at the end, which is just as frustrating, if not harder to debug, as not enough. Maybe it's the way I tend to backstep as I think my way through the code flow, but it never ceases to happen whenever I step foot into Eclipse or Visual Studio...

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

#16

There are so many cool things you can do with JSON. I just created a boolean logical statement builder on a web page by using free form open and close parenthesis, and and/or radio buttons. A little regex to change the parenthesis into square brackets, then an eval(), and I can walk the whole statement recursively.

eval() strikes me as a dangerous thing, security-wise.

How? I'm evaluating strings that are built with my javascript code or from my server code, not arbitrary user input from other users. Yes the user is able to enter parenthesis into a textbox, and those become part of the evaluated string, but I regex replace out everything but the actual parenthesis.
Post reply on HN