News for hackers. Stuff that matters.
Re:The havoc the XML purists wrought by scott_s on Wednesday May 19, 2010 @11:04AM (#1361146)
Which makes perfect sense for documents. So why do we use a markup language suitable for documents for general data? Whitespace matters in a document, but does not matter for data. (I'm not accusing you, I'm actually curious if you know the answer. I've never had to deal with XML.)
Re:The havoc the XML purists wrought by hcayless on Wednesday May 19, 2010 @11:47AM (#1361269)
It's an excellent question. My answer is, use XML for data if you need features that come with it, such as validation, or if you'll want to use it with tools/standards that orbit XML, like XQuery, or if you have a situation where you're dealing with both documents and data, and you want them to interoperate. Otherwise there's probably not a lot of benefit to XML; JSON, YAML, or a DSL will suit you just fine.

A lot of XML-hate comes from its overuse—it comes with overhead that is too expensive for simple cases, but is pretty useful when you go beyond simple. Right tool for the right job and all that...

Re:The havoc the XML purists wrought by bsaunder on Wednesday May 19, 2010 @11:29AM (#1361216)
It may matter a lot for some data... When you send a binary file, would you like all of the zeros stripped? Your insignificant data from one perspective is possiblely significant from another perspective.
Re:The havoc the XML purists wrought by jerf on Wednesday May 19, 2010 @12:35PM (#1361464)
It is not possible to ship binary over XML. Regardless of encoding used, XML rigidly forbids the bytes corresponding to non-whitespace ASCII chars below 32: http://www.w3.org/TR/2008/REC-xml-20081126/#charsets This makes arbitrary binary impossible. You have to base64 encode it or something.

Not entirely relevant to your point, but worth bringing up. (XML doesn't ever mangle binaries, because it simply forbids them.)

Re:The havoc the XML purists wrought by scott_s on Wednesday May 19, 2010 @12:08PM (#1361357)
I don't follow. If you need literal, unstructured data embedded in a structured format, then use whatever escape mechanism the format has.
Re:The havoc the XML purists wrought by astine on Wednesday May 19, 2010 @11:32AM (#1361224)
Because for the longest time there was nothing both better and standardized. I've dealt with xml many times and hate it but It's better than maintaining your own proprietary DTL.
Re:The havoc the XML purists wrought by prodigal_erik on Wednesday May 19, 2010 @12:00PM (#1361312)
Anyone who adopted JSON could have been using s-expressions all along, but it's become a tradition to ignore everything Lisp got right until some brave soul gives it a makeover with curly braces.
Re:The havoc the XML purists wrought by astine on Wednesday May 19, 2010 @12:57PM (#1361524)
In theory, I'll agree with you. However, as far as I know, there are no s-exp parsing libraries for any language I know but Lisp. Also s-exps as they exist in Lisp assume some Lispish concepts that don't map to all languages. Symbols, for example, don't exist in Java. JSON is a better solution for cross language portability.
Re:The havoc the XML purists wrought by wendroid on Wednesday May 19, 2010 @01:14PM (#1361594)
(sorry I want to reply to the reply but there's no reply button for it)

Saying there are no s-expression parsers for non-Lisp is ridiculous.

This one's http://sexpr.sourceforge.net/ for C, it's been in sourceforge since 2002.

perhaps you prefer one in :

Javascript - http://planet.plt-scheme.org/package-source/dherman/javascri...

Perl - http://search.cpan.org/~nelhage/Data-SExpression-0.34/lib/Da...

Limbo - http://man.cat-v.org/inferno/6/sexprs

I shan't go on

Re:The havoc the XML purists wrought by astine on Wednesday May 19, 2010 @03:14PM (#1361993)
I didn't say that there weren't s-expression parsers for languages other than Lisp; just that I haven't found them. I'll be the first to admit that I haven't really been looking.

But you'll note the disparity in support. A library for parsing XML with C may have existed since 2002, but it's existed for XML since 97. In Java, XML support has been baked into the JVM for a while, but S-exp parsers are hard to find. That library you list for Javascript is not a s-exp parser but rather a Scheme library for generating Javascript from a Scheme-like language. Googling for javascript and s-exps returns a lot of results like that but not many s-expression parsers. There certainly aren't any widely used and recognized libraries like there are for XML and JSON fro most languages aside from Lisp.