KBD

Keith Devens .com

Saturday, August 30, 2008 Flag waving
"Why teach drawing to accountants? Because drawing class doesn't just teach people to draw. It teaches them to be... – Randy S. Nelson (dean of Pixar University)
← Conservative Left TurnPop 'N Music →

Daily link icon Sunday, July 13, 2003

XML vs. Programming Languages

Read Sjoerd Visscher's Programming vs. XML.

The API discussions during the last week showed clearly that a lot of programmers are not ready for XML. They prefer XML-RPC because they want to send and receive data structures that are in native form for their programming language. Yet everybody seems to agree that when you are creating a new data format, it should use XML.

For this friction to disappear one of two things has to happen: Either the programming languages change to match XML better, or the other way around.

In the end I think XML will win. The data structures in programming languages are designed to match the computer's memory model. XML's data structures are a result from it's syntax.

I'm sick of all the attempts to integrate XML natively in programming languages. (to be fair, some of those links point to different links referring to the same technology (like XML in ECMAScript and CDuce), but I still feel like I've missed some of the things I've heard about).

Maybe XML will win. But for XML to win and infect all of our programming languages, it would seem to imply that all of our programming languages have been missing a native XML construct for all these years. Quite the contrary, I think. With XML they went and defined a markup language that seems to try to do everything possible, including mixed content and strange XML structures that wind up creating an "ordered multi-map", all of this giving you a monstrosity that I can't imagine any language needing (except of course, just to deal with XML). It just seems a shame that ALL this work is being done on XML to support a data model no one's really ever used much before just because some people wound up creating a syntax that implies this structure. And it doesn't seem like anyone's yet come up with a really good way to process this mess.

I don't know whether this "mixed-content-capable ordered multi-map" data structure will really be useful in the long term. I think it's overkill. Brett Morgan seems to agree:

I think XML will turn out to be yet another silver bullet that was basically useless.

I think programmers do want to have data wind up in their native data structures (this doesn't mean I'm advocating RPC). Consider Mark's example of generating XML. That's about the nicest way I've seen to programmatically generate XML. But I'd much rather just give a dumper a native data structure and have it work, and have a loader take some markup and wind you up with a native data structure.

For document oriented markup, XML's fine. Documents are complex, and documents were SGML's main target area. But most XML data I see besides XHTML is data-oriented markup, and the data programmers deal with is made up of lists and associative arrays. I've never wanted an "ordered multi-map" before, yet this is what XML is giving us. On the one hand, I'm reluctant to say "Obviously what we have now is fine because that's what's evolved after all this time" because computer science is relatively young, and maybe this "ordered multi-map with mixed content" that XML defines will be useful. But I don't think so.

See an example of Why Markup Languages Matter, which I agree with. I just think we have to keep in mind that XML isn't the ultimate markup language. It can be used for many applications only because it's a jack of all trades (I hate to use the cliche) and a master of none. I think for many applications it's better to use a more targeted markup language.

← Conservative Left TurnPop 'N Music →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

August 2008
SunMonTueWedThuFriSat
 12
3456789
10111213141516
17181920212223
24252627282930
31 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

new⇒Johnny Walker Blue Label

Wow, thanks for the scotch review​:D

Lagavulin and Laphroaig are​some of...

Keith: Aug 29, 3:35pm

Girls, please don't get breast implants

Wow, After all this time, the​comments on this page continue to​grow. It wa...

Ajeet: Aug 25, 2:36am

Generated in about 0.148s.

(Used 8 db queries)

mobile phone