Occasionally I'll write about things that I find sort of mildly, vaguely thought provoking, and somehow that writing turns out to be ragingly controversial once posted here. Case in point, XML: The Angle Bracket Tax. I'm still encountering people online who almost literally hate my guts because I wrote that post. You'd think I kicked their dog, or made inappropriate romantic overtures toward their significant other.
I presume youâre using Web Forms for your views on Stack Overflow? Was this a considered decision? Did you consider any of the alternatives such as NHaml?
One thing I really like about your blog is your quotes on other people. I find those quotes to usually been the most reliable part of your posts, since not just you agrees with the guy you quote makes the information more reliable. Quotes are for highlighting points about a topic not about placing parts of other people (or even yourself in a previous publication) text into your own. That said I think you should have taken that part of your podcast rewrite it and place as normal text.
About the topic I find that it mostly does not matter, even more, I think itâs better this way because itâs standardized. Standards are good, even if they are bad. A stantard is better than each one having itâs own language and itâs own parser and so on.
I hate to read XML, but, as Hoffman said, its standardized and almost any dev CAN read it. While it may benifit you to use something else, it will hurt the people who have to read that later.
I do agree that you need to be sane about what you use, but when its only a small difference I say take a hit for the rest of the community.
The other thing XML has going for it is LINQ-to-XML and XML literals in vb.net. There isnât a much easier way to write/parse data in .net.
Iâm actually using this summer to teach myself more about XML and what it can actually do for me past a few simple scripts for websites. Can anyone recommend me a good book for learning XML?
Hi Jeff. Iâve recently defended your blog to a fellow programmer who falls into your âpassionate hatredâ camp, and heâs not the only guy I know who thinks similarly. On the other hand, I know a lot of people like myself that recognise youâre just another bod. Personally what draws me here isnât the technical excellence, but the fact you can repeatably string consistent articles together that can be read by the average joe programmer (me).
I think youâre overstating the mental parsing problem just slightly, and would almost dare to posit that if you canât substitute âfruit=fooâ with âfruitfoo/fruitâ after a few yearsâ of Visual Studio, then youâre probably in the wrong business.
Another aspect is that this could be seen as a tools problem. For the past year or so Iâve reached the opinion that for any formally structured data, there almost certainly exists a more efficient, âhumaneâ representation that should be implemented in a GUI for manipulating that data structure.
While there arenât such things around (yet) for things like C or C# code, there exist quite a few XML editors that implement a number of different graphical interfaces to viewing/editing XML. The beauty in the generality of XML is that a user/programmer is free to pick from any number of different representations that he may use to manipulate the Infoset. The textual tags are just one widely used representation.
Iâm going to share with you the first paragraph of Simon St. Laurentâs 1998 âWhy XMLâ article:
âThe computing press has found a new savior for the ills that afflict computing and the web: XML. XML is new, itâs exciting, and itâs got to be good, because the specification for it looks indecipherable. XMLâs hype level has already drawn fire from some quarters, from those accusing it of âbalkanizing the webâ or of increasing the load on an already strained Internet.â
10 years already. It does seem indecipherable at times (especially when youâre dealing with large XML content).
While xml is horrible to read and isnât going to make anyone happy, using anything else is likely to make someone seriously unhappy. Have you ever tried parsing a csv or similar proprietary file which has documentation that not only was lost years ago but didnât handle the data type you are trying to add anyway?
The mental cost of reading xml is far outweighed by the benefit of being sure that you will be able to read it. Definitely a case of worse being better.
You should go one step further and prove your tax. Write a program using Visual Studio that yields the same result with each dataset. Wouldnât it be safe to say that if everyone wrote their own programs to reach the same result that the XML version would be more consistent then the non-XML version because itâs based on a standard?
XML is generally excise. (Doesnât About Face have an entire chapter on this?) When XML is presented to humans as the main means of modifying data or software state, you should be using something different (i.e., an actual UI). That said our content management system wouldnât exist without XML and XSLT, and I love both very much. Our users are none-the-wiser, however. XML is the pain that software developers bear so our users may lead happier, healthier lives.
Once again, the issue is that XML isnât meant to be parsed by a human. Itâs intention is not to be human readable - the verbosity that is so annoying to a human brain (because we can interpret the meaning from context) is absolutely essential for software. Thus, I think the solution would be a translation layer for human viewing/editing of XML files. Iâm sure that XML viewers/editors already exist (a quick Google search shows that they do). Maybe you should give one a shot? If you can get a plugin for Visual Studio, the entire problem would be solved.
My problem with XML isnât as much the strain of having to read it; itâs more of how bloated it has become.
If I recall correctly, XML was derived from XHTML, which has itâs basis in HTML. So, in theory, XML is really just another text markup language. Iâm not going to argue with the ability to create your own markup tags that can be parsed to mean whatever you want them to - quite the opposite, in fact. That feature is (hands-down) the most powerful aspect of XML.
Unfortunately, when you give people that much power, it inevitably goes downhill. Think of what XML was intended for (custom text markup), and now think about what it is being used for nowadays (configuration files, data transmission, data persistence, reporting, etc.) How much of the âusefulnessâ of XML is due to the ability to throw whatever you want into a file along with the rest of a loose collection of information, which might not even be relevant?
This doesnât even begin to take into account the extra overhead associated with parsing, reading and writing the information as you said in you previous post. Add that into the mix, and (to me, anyways) the case against the widespread proliferation of XML grows stronger with each opening and closing tag.
So the question I pose is this: is the advent of XML as a universal data type (for lack of better wording) making us better programmers, or is it causing us to slide backwards into the olden days of placing everything having to do with anything into one place for âeasierâ access?
Hi Jeff. Iâve recently defended your blog to a fellow programmer who falls into your âpassionate hatredâ camp, and heâs not the only guy I know who thinks similarly.
âThe dogs bark: a sign that weâre riding, Sanchoâ. (Don Quixote, via Jorge Diaz Tambley)
Once again, the issue is that XML isnât meant to be parsed by a human. Itâs intention is not to be human readable
I desperately wish someone would explain this to all the people writing XML files. Oh wait, we have.
Wouldnât it be safe to say that if everyone wrote their own programs to reach the same result that the XML version would be more consistent then the non-XML version because itâs based on a standard?
The idea that thereâs only two choices: XML or âwrite it all yourselfâ is sort of⌠a lie.
The power of software development is that it is one of the most efficient methods of expressing our will. Once it was people being taught a process, then it was mechanically expressed in assembly lines, after that we had hard wired chips and now it has moved into software. But, no matter how this has changed, it has always been about the best method to express our will and the backbone of that is passing information efficiently. It isnât about XML, Corba or whatever⌠as sure as XML is a certainty as a format to store data for the next 100 years, in 20 years weâll look back and laugh. I think a good phrase here is, âEvery 1000 years, the followers of the current mainstream religion look back at the followers 1000 years ago and ridicule themâ. The difference for us, is that we see multiple changes like this within our own lifespan and yet, when weâre stuck in the middle of the current new fad, we lose perspective and somehow forget about the last 10 technologies which were the promised golden bullet.
How about the mental cost of learning the syntax of a bunch of new parsing languages? YAML, ini, bleh. I already know XML, why would I care to learn additional mechanisms for storing configuration/data persistence?
How about the anguish of working with immature and buggy APIs that parse these languages compared with the proven and stable apis that are built into Java/.NET? I donât need an external DLL. I donât need to unit test that piece of code. With XML, it just works right out of the box.
How about training costs? I lead a team of 5 engineers. I have not had to explain XML to a single one of them because they have either known it coming in (due to the pervasiveness of XML and .NET) or they were smart enough to look it up on the internet. Can you say that for the configuration flavors of the month your propose.
Jeff, I think your frustration comes from a lack of tackeling enterprise level apps. These rants are starting to sound like Joel not likely Exceptions or the need for a new language. You are so overly concerned with the little details that you miss the bigger productivity picture.
If you think about it from a Domain Driven Design (http://en.wikipedia.org/wiki/Domain_driven_design) perspective, XML is just a persistence layer. Itâs unimportant and you shouldnât be spending time on it. Focus on what matters - the domain.
The passionate hatred reminds me a little bit of some Firefox fans, for example. Donât get me wrong â I use Firefox and Iâm happy with it, but I donât get into any heated discussions about it. Itâs just a browser. But a quick visit to some random web forums, and youâll inevitable see people turn into raging lunatics when they talk about how much better it is than IE, and how dare anyone say anything bad about it (or abbreviate it the wrong way, for that matter).
I know the word has become trite, but fanboyism is probably the best way to describe it. Whether itâs XML, or Firefox, or Ruby, or Linux, or Microsoft, or whatever. Use whatever you wantâthereâs no reason to feel threatened when someone else prefers something different. It seems as if a great deal of people are either insecure about their tools and software; or perhaps they consider it so much a part of their own identity they feel that a criticism of their tool is a personal attack.
Whatever the reason, that kind of reaction to your original post certainly speaks volumes about a personâs maturity level.
I already know XML, why would I care to learn additional mechanisms for storing configuration/data persistence?
I might ask you a similar question: why learn anything beyond exactly what is required?
Iâm not proposing that everyone stop and rewrite every application written in the last 5 years, merely that people understand and are aware of the alternatives.
No oneâs mentioned them in this comment thread, but theyâre inevitable so I feel I should get it out there this time: Lisp S-expressions offer all the standardization and consistency of XML with far less syntactic noise. S-expressions were also conceived as a âmachine formatâ as opposed to a human format, but they are eminently more usable. Why theyâre not in wider use these days I have no idea.
Not much to say here besides that, but really - theyâre easier to parse and generate for both computers and people. Theyâre lighter-weight and at least as extensible. Coincidence is not a good enough reason to maintain the use of XML over simpler, saner formats!
Isnât XML just another âbug-ridden, slow, ad-hoc implementation of half of Common Lispâ with better marketing?
I really donât mean this as a troll, Iâm just so dissatisfied with XML that I react strongly when the topic comes up. Sorry!