News for hackers. Stuff that matters.
Re:XML: Contrary to popular belief, it doesn't always kill b... by tsaixingwei on Saturday February 19, 2011 @08:13PM (#2240569)
I find that one thing you can do in XML but not in JSON is comments. There isn't any equivalent of XML Comments in JSON. Frequently, my configuration files require comments to show what options are available, or to easily turn off an option temporarily by commenting it out. I don't see how to do that if my configuration files are in JSON.
Re:XML: Contrary to popular belief, it doesn't always kill b... by Groxx on Saturday February 19, 2011 @09:29PM (#2240756)
I'd imagine it depends on your parser, and if non-browser JSON gets more prevalent it'll probably be addressed. JSON has no format specified that I'm aware of, but some browser-like parsers will handle things like this:

  {"key":"value" // comment
  or 
  {
    // comment
    "key":"value"
Which I find wholly acceptable (though poorly supported).
Re:XML: Contrary to popular belief, it doesn't always kill b... by tsaixingwei on Sunday February 20, 2011 @06:16AM (#2241651)
Wouldn't that only work if the json/javascript is pretty-printed and not minified?

I'd think this problem of comments in JSON requires a solution that is part of the JSON specifications rather than dependent on individual parsers implementations.

Or perhaps JSON only really shines as a data interchange format and not much else.

Re:XML: Contrary to popular belief, it doesn't always kill b... by nailer on Sunday February 20, 2011 @04:18AM (#2241494)
Sorry, on iPad and accidentally downmodded your useful comment.