Variable Name of the Day
July 27, 2006
While working on a project today, I was browsing through source code on a number of sites to see how people smarter than I have done things that I need to do as well. I was looking through some JavaScript and found this:
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5.2') != -1
&& navigator.userAgent.indexOf('Mac') != -1);
I know what it is to tear your hair out trying to get something to work in one browser or another. I’ll bet this guy spent a full working day fiddling with that browser before giving up and just writing a little function to let users of bugRiddenCrashPronePieceOfJunk know that they need to update their browser!