Representation, Again

I mean, XML is better if you have more text and fewer tags. And JSON is better if you have more tags and less text. Argh! I mean, come on, it’s that easy. But you know, there’s a big debate about it. [Steve Yegge, via Simon Wilison]

I’ve been asking that question in interviews, and I don’t think there’s still a big debate about when to use XML and when to use JSON. It’s now settled.

And Yegge’s answer is not quite right. I think the difference is between structural markup and key/value pairs.

However, there are also cases when you should prefer text/plain over JSON. A hint: every object in a Second Life sim might have an HTTP engine running in it.

More like this: , , , .

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*