James Rishabh Mishra
Nonsensical question. For data or as a markup system? JSON is better for data as it's a much simpler and easier-to-parse format, as well as handling types more rigidly. XML is clearly better for markup, however, as that is what it's meant to do as a grandchild of SGML. - i80and
Whichever is the right tool for the job, no? - Victor Ganata
Depends on the task. Data transfer over the wire, JSON. Data markup, XML. However, the benefits of JSON fade fast once you can't eval() it, so outside of JavaScript it's a matter of what tools are already avail, because I don't want to write a JSON parser when I already have one for XML. - xero
I'm amazed that nobody has given the answer of either XML or JSON. I was expecting some fanatics to come in. No fanatics? - James Rishabh Mishra
I'm a JSON fanatic. I used to love XML but it's a complete mess, used in places it was never intended, way overused, and is simply way too verbose. - ·[▪_▪]·
nicerobot, is it XML's fault that it is used in places it was never intended for, and way overused? - James Rishabh Mishra
both. JSON is a great final representation for JS-supporting clients. XML is a great server-side format that is easily transformed into HTML, Atom, RSS, PDF, and -yes- JSON. - MikeAmundsen
Mike, are you saying that JSON should only be used in situations involving Javascript? - James Rishabh Mishra
@possible: '..should only..?' - nope. i'm saying it's great for JS-supporting clients. designed by JS people initially for JS uses. i think that's pretty cool, eh? - MikeAmundsen
JSON should ONLY be used where JavaScript is being used... why? Because it is a JavaScript Object... the problem with JSON is there is no dictionary. Data isn't typed, there is no definitional data. It works for some things... but not for many things. - Brian Roy
JSON is good in any place where minimal markup is needed but a binary format is too much (or not possible). All it really needs is a good parser in many languages, like XML has now. You have to remember, just because we're talking XML and JSON doesn't mean we're talking about coding websites. And even when we are, there are places where each is a better choice. Use the right tool for the job. - xero
xero (sorry for messing that up) - if you want minimal markup why not use CSV? - Brian Roy
ASN1 - Todd Hoff
Of course XML can't be at fault. I've just grown so sick of it used in places that just about anything else would have been a better choice, it's seriously soured me to XML at all. it was good for building standards but what we really need is, and it's coming, fluid transitions from markup to language structures. The underlying markup should not be a concern. - ·[▪_▪]·
CSV can't capture hierarchical relationships very well, and it is nowhere near as human readable as JSON. But it is a great choice if you don't need to read it often to debug and have a simple tabular data format. - xero
I have to agree with the others that it depends on the situation. I am working on an app where we are storing the data in XML format but passing it around to various services and clients via JSON so there is serialization back and forth... This is the first project that I've really had the chance to use JSON on and I like it a lot. I just wish there were a "native" parser for it to C#, but in C# 4.0 I think we'll be pretty close with some of the new language features. - Lindsay
@Lindsay: i found the Nii.JSON library for C# quite solid [http://www.amundsen.com/blog...]. along with general use, i employ that library to handle some standard JSON->XML conversions for internal processing [http://code.google.com/p...] - MikeAmundsen
Mike, you should share those on FF - xero
@xero: i added a blog post and ref'd it here [http://friendfeed.com/e...] - MikeAmundsen