About Me

I am a computer programmer. I do programming professionally and for a laugh.

Technical stuff on programming, java, DSLs, etc...

Saturday 1 August 2015

Epic fail number 2 - XML

I wrote the below a while ago, never really bother to publish but I just found a quote of Linus Torvalds;
XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist.
So may be it is time now. Anyway, here it goes:

The second (after the epic null fail) biggest blow on the software industry is the invention of XML. We sometimes reminiscence with my esteemed colleagues about how code was purposeful back in the day when computing resource was much more scarce. If you sent a message over the wire, or read a file, every byte had a proper meaning. The first 2 was the length, the next 4 was the command etc. 

Now, there is XML. How many bytes do you really need to represent a index future? Or do you really need a piece of XML to represent how your objects bind to each other?

It isn't even good tagging, look at this;

<message>Seriously?</message>

Can you even close a tag that you haven't opened?

Why not <message>This is correct</></> being some generic close tag? (I have to admit I have not thought this bit through, feel free to embarrass me if I am missing some obvious point)

I appreciate the need for self describing data, when the data needs to be self describing. But when you have applications entirely in house developed do you actually need that? May be one day I will have a go at calculating the wasted bandwidth because of XML as a messaging format.

I also appreciate that some software configuration (code proprietary?) is better human readable and editable. But when was the last time that anyone has edited a spring file to change the class binding and deployed without a build? I read (and refactor) a java class much better than XML. Also automated builds and strict controls on production systems make it almost impossible to touch touch any code without a build.

So why bother? Actually, don't.

No comments:

Post a Comment

Followers