To see ourselves as other see us

After years of writing object existence testing code intended to filter out and then compensate for any inferior browser, that mainly had the effect of filtering out Internet Explorer, it’s interesting to see the other perspective, as Joshua Allen makes detecting particular versions of Internet Explorer, and then calling everything else trash, sound like it’s reasonable and expected (despite the fact that he’s talking about its imminent and inevitable mass failure in the face of IE7):

this.ie5=(navVersion.indexOf("msie 5.0")!=-1)?true:false;
this.ie55=(navVersion.indexOf("msie 5.5")!=-1)?true:false;
this.ie6=(navVersion.indexOf("msie 6.0")!=-1)?true:false;

Note the problem here — all of the IE versions are very precisely defined, and Netscape is defined to be everything else. This is a very common pattern in browser detection, and it has nothing to do with CSS bugs in IE. IE is the up-level experience that has the most capabilities, and the non-IE setting tends to be the catch-all downlevel experience that provides the lowest common denominator. As Firefox continues to catch up to built-in IE functionalities like XmlHttpRequest and rich edit, this may become less common, but for now non-IE == lowest common denominator in the majority of cases.

Oh, and Joshua? Your customers hate you for the way you’ve built that attitude into the tools you sell them. I read their bugs when they say that Firefox messes up their FrontPage-produced photo gallery, and then I email back and forth with them after I explain to them that it’s because Microsoft gave them a tool that thinks that everything but your browser is Netscape 4, and should be given broken and useless HTML and script and CSS, and they don’t like it one bit. That sort of attitude works well to maintain allegiance among your strongest supporters, the ones who will tell their own customers to use IE or just keep their damn money, but it doesn’t do a thing for all the rest, beyond increasing their frustration with the whole situation.


Comment by Arve Bersvendsen #
2005-07-25 23:48:55

I most certainly hope IE7 will break on the majority of the world’s stupid web sites. You know, those who are so stupid that they think the user agent is indicative of anything.

Comment by Ian #
2005-07-26 02:18:37

Hmm, I notice IE7 is still ’Mozilla/4.0’ – probably means they’ve not fixed much CSS stuff :(

Comment by Ian #
2005-07-26 02:32:47

Also, it’s a pity… if IE7 had good enough standards support to qualify as a ’Mozilla/5.0’ browser, we could just sniff ’Mozilla/5.0’ as a modern browser and anything else (including IE6) as a legacy one.

Perhaps that’s one reason they didn’t change it, so that tons of websites didn’t switch to this and lock out IE6 of their cool new content, forcing win2k/other non-xp windows users to Firefox.

Not that it couldn’t be done, just that it would be alot easier with a ’Mozilla/5.0’ in the UA string of IE7.

Comment by Keith Gaughan #
2005-07-26 06:43:48

Ian, it’s not a good idea to use the browser string for sniffing at all, and I think that’s one of the underlying things Phil is getting at. People ought to be sniffing for objects these days if they’re uncertain, not browsers.

Comment by Pete Prodoehl #
2005-07-26 08:26:46

I’m not even a customer and I hate that sort of attitude…

Comment by James Robertson #
2005-07-26 14:41:15

Check out the post – note the update time of 4:33 pm? All the comments disappeared.,guid,8146c176-f43d-4f26-abda-fb6548df39da.aspx

Comment by Mike Owens #
2005-07-26 16:04:20

It’s quite distressing to spend a few minutes writing a comment to a post, and find it just deleted hours later, as if the time spent just disappeared. If he doesn’t want commentary, he should disable comments. Selectively deleting comments of actual substance shows a complete disrespect for his readers.

But hey, whatever allows him to live in his crazy bubble…

I had a copy cached including the comments:

Comment by Joshua Allen #
2005-07-27 17:10:00

Phil, I really thought I was agreeing with you — this is a common pattern (the most common) and it is not a good pattern; my whole point was to explain why this kind of browser detection pattern or attitude is a bad thing, and that it’s going to break people. I certainly wasn’t trying to endorse it. Anyway, I would hate to have that important message about a common bug get obscured by coming across arrogant; so your feedback is valuable.

Comment by Phil Ringnalda #
2005-07-27 18:25:28

And the funny thing is, when I just re-read your post with my ”this is Joshua Allen writing, he’s one of us no matter where he works” glasses on, I could hardly see where you triggered my ”time to rage at MS” button. Without the third paragraph, right after the code sample, I would have just said ”yep, Joshua’s right, people who version-sniff IE and think everything else is crap are going to have to update their misguided code to not give IE 7 the broken stuff they give us.” Something in that one ’graph, probably ”downlevel” which I strongly associate with really bad browscap.inis giving me NN4.x-specific CSS, just burned through the rightness of anything else you might have said.

Given our general tone of comments, where we act like alpha transparency and our favorite obscure CSS 3 feature are the most important things on the face of the earth, I wouldn’t much blame you for giving up on writing with us in mind entirely (IE Blog post: ”This menu does foo”; Gecko-fan comment: ”Yeah, but what about alpha transparency and CSS3 box-shadow, huh? Huh?”), but if you haven’t: actually using the words ”downlevel” and ”uplevel” in any way other than making fun of the concept is likely to turn up our burners.

Comment by Joshua Allen #
2005-07-27 19:23:12

Yeah, the third paragraph was meant to be from the perspective of ”here is probably what the guy who wrote that code was thinking”, not my personal preferences. I can see how it wasn’t very clear though. I just clarified the post a bit to make it crystal clear that I’m not endorsing it and that there are other reasons for this pattern.

Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.