Jeff Atwood mentions the Angle Bracket Tax and not surprisingly, I don’t agree. XML can be difficult and painful at times, but I think the reasons are not entirely technical. Recently, I had the opportunity to work with XML in Java and it was definitely “taxing”. Even though the process was frustrating, it really had little to do with XML. The biggest pain was actually Java.

After working in Python/Ruby for a good portion of time, declaring types, long CamelCase variable/class names and overly complex Object Oriented patterns feel painful. I’m not much of a Java hacker, so most problems could be chalked up to my lack of experience in the language. While a better understanding of Java would have been helpful, in learning XML and C# I had a very similar (and frustrating) experience, which makes me believe it is not necessarily the XML. After working with XML in Python (and Ruby to a lesser extent), it is clear that the real problem is not an “angle bracket” tax. In fact, I would argue that I got a “tax return” by understanding concepts like DOM, which I became exposed to through JavaScript, rather than Python.

It is fine to think XML is “hard” and as I said before, it can be frustrating. But to consider XML the source of frustration probably is not considering all the factors. Jeff’s blog generally focuses on programming and human factors and this is a great example of a human factor. If you expect the static typing, wasteful OO patterns and require IDE support, then you have accepted the struggles as normal. When you then are forced to deal with XML, the common links to OO ideals and patterns don’t match, leading you to the conclusion that XML is hard. The people who breeze through XML and enjoy the technology are simply those who have invested a little time in learning basic tools. Of course, these people also have set their own expectations regarding XML, but therein lies the secret.

Programmers are supposed to be logical people who make decisions using reason. The reality is programmers are people with irrational feelings and emotions that impact decision making. There is a good chance your criticisms of XML are rooted in the thousands of blog posts saying XML sucks. There is an even better chance you promote tools such as YAML without ever actually having used it heavily. Opinions obviously have a place in software, but so does logic and reason. The next time you deal with XML, take a minute and try to learn something new before complaining. When I recently worked with Java, I went ahead and put aside my frustrations for a bit to get a good handle on Ant. Lo and behold, it was interesting and I learned something new that helped improve my perspective on Java. If you take the time to learn XML basics with an objective mindset, you might still say it sucks. On the other hand, you might realize it is not so bad.

*Update*

Seeing as the first comment I received on this post mentioned it wasn’t very clear, I made an effort to clarify where I was going with this post. For the record, I’m making an effort to become a more prolific writer. Please feel free let me know when I just threw up something completely unreadable.