Tag Archives: annoyances

XML Sucks

So, since the professed goal of this blog is to talk about software, coding, and related geeky things (I do reserve the right to be completely erratic and off-topic, however), I thought I’d start with a few of the things I’m most opinionated about… starting with something I hate: XML.

Don’t get me wrong. XML has made it possible for clever people to do some very, very clever things that were much more difficult beforehand. I think the problem is developers who, having become comfortable with their XML hammer, decide that EVERY task involving serialization, data transfer, configuration, etc. is a shiny nail waiting to be beat into submission.

It’s not.

If you’ve ever had to support a legacy, vendor-supplied “solution” that has minimal, useless documentation, and found that the only place you can learn anything about what’s happening is by poring through megabytes of XML files that reference other XML files, that reference undocumented crap that was designed by a retarded monkey who learned XML only because he wanted to be employable after the Y2K COBOL rush… yes, this actually happened to me.

I’m still in counseling.

Now you’re probably about to comment, “Jason, don’t blame the tool for the incompetence of the one using it.”

You’re partially right. But I can blame the tool for encouraging the attitude that leads to such incompetence. “XML is eXtensible! We can use it for anything! And why bother validating it, our code parses it just fine.”

You validate it because several years down the road another coder is going to have to go through it by hand because it won’t parse on anything standards-based. You aren’t a sadist, are you? I mean, you’re obviously a masochist, you voluntarily work with COBOL and XML. But be nice to other programmers, at least. Where’s the solidarity?

But, I digress.

Maybe there was a time when alternatives to XML were far and few between. But that time is not now. Now we have YAML, JSON, and many other perfectly good formats for data serialization and configuration. Take the time to make life easier. Ask yourself, what is the simplest thing I can use to get the job done?

Sometimes, you’ll have to use XML. That’s okay. Sometimes a hammer is the right tool.

The rest of the time, you look like an idiot, sitting there banging away on screws.

Advertisements