Once upon a time there was the great debate over JSON vs XML. The past few years have seen JSONs popularity rise despite XML (and other formats) being well-established. Our own statistics on ProgrammableWeb show a significant increase in the number of JSON APIs over 2009/2010. During 2009 there were only 191 JSON APIs registered. So far in 2010 there are already 223!
But the increase in JSON APIs doesn't appear to be at the cost of XML APIs. Undoubtedly some providers are setting a preference of one data format over another, but it seems the greater majority are simply making their data available in both formats, especially as many application frameworks make this a fairly painless task.
This is good news for us seasoned developers as we have more choice. For newer developers though, choice can be more of a hindrance than a help. Even for more advanced programmers, the question of which format to use can be a tricky one to answer.
However, I think David Megginson put it most succinctly:
"Personally, I like XML because it’s familiar and has a lot of tool support, but I could easily (and happily) build an application based on any of [them] — after all, once I stare long enough, they all look the same to me."
All said and done, it seems as though personal preference, context and the needs of the application are the most important factors in determining which format to use. Ultimately, though, isn't it the data that's most important?
Which format do you prefer to consume and why? If you're building APIs, what challenges are you facing making data available in both formats? Let us know in the comments!