in reply to Re^8: Are there any issues with JSON
in thread Are there any issues with JSON

I don't have time to go dig up examples from where I've used JSON but I wanted to tell you what I find to be the greatest virtue of JSON: cross-platform objects. Oh yeah, and the main reason people use it is that it's much less verbose than XML (less bandwidth).

If you pass JSON into javascript, it's trivial to inflate the object, add a prototype and "bang! it's an object with behaviors". Typically you would have methods that display, edit, whatever that data. When you're done, you pass the JSON core (data) back to your Perl server. On the Perl side, you can easily inflate the JSON to a hash and bless it into a class that provides persistence (or whatever). Well, anyhow, that's what I find awesome about JSON.

Replies are listed 'Best First'.
Re^10: Are there any issues with JSON
by taint (Chaplain) on Jun 06, 2014 at 02:50 UTC

    Well, that sounds encouraging. I can't believe I haven't looked this direction earlier.

    Thanks!

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

      Right, unvalidated data, that becomes an object you can call methods .... no no no no no no no no no no no :)

        You do raise a valid point but I'll hope you'll notice that I never said "don't validate your data". I was just trying to illustrate an idea. Anyhow, I do agree, not about the validation but about "this is an idea that is full of danger". While I completely agree that this is a horrible model for a banking web app, I still think it could be slick for something like a recipe database that accepts user submissions. I mean really, what's the difference between an object using methods to validate and store a new recipe versus using the traditional posted form data?