TRUNCATE TABLE master..sysdatabases

...and other neat SQL Server tricks
posts - 55, comments - 60, trackbacks - 14

Is XML Evil?

About a month ago I was asked by a contractor I work with who needed to import some very plain, fixed-width, ASCII text file data into SQL Server. In fact, this SQL Team post is very much like his situation, in that he also was going to convert PLAIN, FIXED-WIDTH, ASCII TEXT (did I mention that already?) into XML and THEN import it into SQL Server. I was absolutely floored that someone would even CONSIDER doing it this way. The only analogy I can think of is taking a haiku that perfectly expresses an idea, and then spend months or years writing a multi-volume thesis on it.

Fortunately (!) we use SQL Server 7.0 so none of the XML extensions were available for him to use. As it turned out I already had a bcp format file that could read the text format he needed to import. So, with ONE LINE OF SQL, I was able to do something he would have had to write over 100 lines of C# to parse the file, XML-ize it, and then save out to ANOTHER FILE so that he could import it (using about 12-20 lines of SQL, or more) Using bcp also would've entailed one DOS prompt command. Even DTS would've been harder to use to accomplish the same thing.

So, exactly how is XML making this process easier? Where is the ease of use and interoperability it's supposed to provide? I'm completely astounded that so many people have been so thoroughly brainwashed by the XML hype that they not only see it as the best way to do something, but as the ONLY WAY TO DO IT. How did they get that way? They don't even realize they're adding bloat that they will strip out ANYWAY when they put it into a database (man, I LOVE listening to people ask why their databases are so much smaller than an XML version of the same data)

I can't help but feel that this example is not just a (minor) lack of knowledge but also a (major) lack of common sense, and of course it's not the only one. It's like building a machine that ties your shoes for you...indeed, consider the time, effort, and money needed for research, development and production of such a machine and compare it to those made by the software industry towards XML. Normally I laugh at or ignore the more alarmist types who publish stuff about the declining state of programming and database knowledge, but now I'm not so sure. Like I stated in the SQL Team thread, we've put men on the moon without XML, and done nothing comparable with it. Why does everyone now believe it's essential for even the most mundane tasks? Maybe (?) I'm just getting old(er) and cranky(er).

Anyway, I'm posting for two reasons: first, for anyone and everyone here to contribute any similar misuses of XML that they know of. By all means be funny, entertaining, scathing, sad, however you feel about it. I'm not looking for an XML-bashing session, but it helps to know when NOT to use a thing just as much as when it should.

Second, I'm equally interested in anyone who really DOES use XML like it was intended, where it truly is the BEST way to accomplish the goal (and hopefully how you managed to work your way into using it from some other method)

And if anyone is interested, I do use XML too, but only for one project that requires a heavily formatted HTML document. XML and XSL were the best way to do it. :)

Print | posted on Sunday, September 28, 2003 2:10 PM | Filed Under [ Stupidness ]

Powered by:
Powered By Subtext Powered By ASP.NET