in Search
     
Latest post 03-30-2007 12:51 AM by amilr. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-26-2006 4:38 PM

    • cruizer
    • Top 10 Contributor
    • Joined on 12-14-2005
    • Singapore
    • Posts 944
    • Points 22,590

    JSON vs XML as a data interchange format

    http://www.infoq.com/news/2006/12/json-vs-xml-debate

    not strictly .NET-only; this info can apply to any web app platform out there (PHP, Java, RubyOnRails, etc...)
    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 35
  • 03-24-2007 10:23 AM In reply to

    • jakelite
    • Top 50 Contributor
    • Joined on 03-21-2007
    • Makati/Mandaluyong
    • Posts 27
    • Points 500

    Re: JSON vs XML as a data interchange format

    How about XML vs JSON vs YAML?

    the short answer i gues is theyre all doing the same thing in a different way. but when you talk of language integration, JSON works well with Javascript. YAML works without modification in Python and Ruby. XML i guess is generalized and interoperable with almost every language having xml libraries.
    • Post Points: 20
  • 03-24-2007 12:43 PM In reply to

    • keithrull
    • Top 10 Contributor
    • Joined on 08-08-2005
    • San Diego, CA
    • Posts 1,956
    • Points 39,255

    Re: JSON vs XML as a data interchange format

    How about XML vs JSON vs YAML vs REST?

    http://tomayko.com/articles/2004/12/12/rest-to-my-wife

    devpinoy sig

    • Post Points: 5
  • 03-30-2007 12:51 AM In reply to

    • amilr
    • Top 500 Contributor
    • Joined on 03-30-2007
    • Posts 3
    • Points 20

    Re: JSON vs XML as a data interchange format

    The best explanation I've read for using JSON was from a comment to Dave Winer's post (also quoted in the infoq article). It was from Joe Hewitt, one of Firefox's developers:


    ...
    It was simply that developers working with JavaScript realized that the language itself had a nice shorthand syntax for encoding generic data structures, and ran with it.

    Even if you don’t buy the performance argument, it’s just much more natural and less verbose to work with a hierarchy of JavaScript objects and arrays than to crawl the XML DOM. Even if the time to call parseInt() or object.getAttribute(”foo”) is negligible, I would much rather have my integers as integers from the beginning, or write “object.foo”.

    So, at the end of the day, it comes down to a question of usability. JSON is just much more usable than XML if you’re writing JavaScript.

    I just want to also add that I think it’s wrong to consider JSON a replacement for XMLRPC. If I were publishing a web service API, I would offer both. JSON is simply a pragmatic concession to the growing JavaScript/Ajax community, but it doesn’t make much sense to me to write a JSON parser for other languages.

    It would also be dangerous to do so, since JavaScript is one of the few languages that most commonly run sandboxed, so it is safe to directly eval() an incoming data packet. I wouldn’t want to eval() a Python or Perl data structure on my web server like that.


    • Post Points: 5
Page 1 of 1 (4 items)