Wednesday, October 05, 2011

Running out of Lipstick

Over the past several months, I've spent some time fixing lots of jQuery event bugs related to Internet Explorer 6, 7, and 8 in preparation for the upcoming jQuery 1.7 release. Most of these were jQuery bugs in the sense that we didn't put enough extra lipstick on the pig to make it seem as attractive and standards-compatible as modern browsers. One phenomenon that interested me about these bugs was that they had all been reported in the past 18 months, but had been in jQuery for several years. So if that is the case, why were they just being reported now? I have a theory.

If you were a web developer five years ago, you had to really know the quirks and inconsistencies of the major browsers of the day, primarily Internet Explorer 6/7, Firefox 2/3, and Safari 2/3. Libraries like jQuery were created to help developers deal with those problems, but nearly all developers were well aware of the issues that were being normalized within the library. That usually meant their own battle scars prevented them from going into territories where they'd been burned before, so jQuery's valiant-yet-imperfect attempts to fix IE were good enough in most cases.

Today we're seeing a whole new generation of web developers. They write standard HTML, jQuery, and JavaScript with an expectation that all browsers obey the standards. They're developing complex pages and even full-blown applications using Chrome Developer Tools and Firefox with Firebug, often on their Macbooks. Late in the process they spin up a VM with Windows to test in IE6/7/8 and find that something breaks due to subtle differences in the way those older versions of IE disregard the standards. So they file a bug with jQuery, and we add more lipstick.

As the older IEs become less mainstream yet still important, it's probable that IE-related jQuery bugs will continue to come in as developers discover more ways that their standards-based hopes are dashed. If it's feasible we'll fix them, but that doesn't excuse any web developer from having a basic understanding of the quirks and pitfalls of IE. There will always be things that jQuery can't fix--eventually we're going to run out of lipstick.

The good news is that the rewritten IE event support in jQuery 1.7 closed many bugs and actually reduced the size of that code by nearly half, so the world is paying a much lower price for it. Only time will tell if that code meets the expectations of developers who expect strict standards compliance, even from browsers released in 2001.

1 comment:

Richard D. Worth said...

Spot on, Dave. Love the analogy. Even though we can't dismiss these browsers for still many years in the future, it's refreshing to note the comparison of the workflow you just described to the norm of 5+ years in the past, where it seemed like 50% of a developer's time was spent supporting IE6 vs. the rest of their time with other browsers. Because they had to pass through the thorny fiery way before they had those scars, and that took time.

As long as these older versions of IE are in common use that number will be non-zero, but we've come to a point where we compound the investment by pouring it into a shared co-op effort. If it weren't for that, we'd be dealing with all the surface issues repeatedly (as many did for many years), but now we're able to dig deeper and deeper to fill those tiny cracks.