This has been bugging me for a few weeks now, as a deeper-level problem. Part of my job (not just at DVC, but at previous companies) involves figuring out why products I work on break on certain web pages. QA says “We’re broken on this page,” and before I can work on the bug I have to dismantle the page. Imagine how much fun it is to dismantle code like:
<div><div><div><div><div><div><div><div><div>…</div></div></div></div></div></div></div></div></div>… Or the horrors of table-based layout, especially nested-table-based layout. This practice is officially known as “minimizing a testcase”, but realistically it ought to be called a steaming pile of fertilizer. No one wants to do it, and pages using hyperbloated markup make it ten times harder. (Especially when one character of whitespace can make the bug disappear.) Then there’s the worst feeling of all: minimizing a testcase, fixing the bug, and then finding out there’s something else busted on the same page, which your fix didn’t catch.
Seriously, how much code should a web page need to implement a tabbox?
I just spotted from GMail a Quote of the Day that really summarizes this well, by Gen. George S. Patton: “If everyone is thinking alike, then somebody isn’t thinking.”
There are design flaws in the whole process that make some of this unfixable in its current state. XML Namespaces has been around since 1999, but HTML isn’t XML (unless you convert wholesale to XHTML). So as long as we keep generating web pages with just HTML, we’re stuck. On the other hand, HTML isn’t going to go away any time soon.
Maybe it’s a standardized user-interface language we need. Mozilla has XUL (which has never worked as well on web pages as it has for chrome apps), Microsoft has XAML (oh, wait, you need Vista for that, don’t you?), and somewhere there’s a W3C discussion about creating a unified UI language (but how credible is the W3C among developers these days?).
The Tamarin project should improve JS performance significantly (and when it does, Microsoft and the others will be forced to respond – good news for all users), but this doesn’t solve the underlying problem – it just makes the problematic code run faster.
Of course, all this is “Web 2.0” – but I don’t think anyone really understands that Web 2.0 should be easier to work with than Web 1.0. Web 2.0 shouldn’t just be about cool widgets.
How can we, particularly Mozilla developers, contribute to a fix? (It’d be the height of arrogance to ask “How can we fix this ourselves?”.)
Another way would be to make a standard user-interface language for the web – and implement it so that web pages could use it. Stop downloading cruft from the web – store it locally on the machine as sandboxed components. (Think XTF or XBL without privileges to implement user-interface.) Make it something that doesn’t need a whole package from Yahoo!, another package from Google, another package from Tom’s Best User Interface Widgets Page, etc. Just make it something everyone can use. And if it means a plug-in for a stubborn vendor, hire someone to write the damn plug-in! (Provided that the plug-in itself has a clearly available spec and a clearly available owner.)
I think the biggest impact we could have would be to ask the people who build and maintain these major sites, “Hey, what can we add support for that would make your jobs easier and your code cleaner?” It would not surprise me to find out that Mozilla was already talking behind the scenes to CNN, Ebay, Yahoo, etc. – specifically to their web engineers. It also wouldn’t surprise me if they weren’t, but instead focusing efforts on making the browser UI better, the user experience better, and on meeting standards that these major sites just don’t give a damn about – while still trying to render these sites well.