Sniff my browser: The Modernizr inadequacy
nefariousdesigns.co.uk
Sniff my browser: The Modernizr inadequacy
1–10 of 16 posts
Re: Sniff my browser: The Modernizr inadequacy
#2Re: Sniff my browser: The Modernizr inadequacy
#3Re: Sniff my browser: The Modernizr inadequacy
#4First, the Modernizr file ends in ".js" I don't think anybody is fooled about how it works and what its consequences are.
Second, the advocated method of stying your site with Modernizr is to first make it look good assuming no "advanced features" exist and then progressively enhance. This ensures that the failure of Modernizr to load will leave you with what you started with. Given that the Modernizr classes are added to the root of your document this claim seems impossible:
"However, it also means there is a significant loss in the overall structure of specificity within your stylesheets, which could easily cascade unintended effects through to other elements."
Finally his core argument is that Modernizr violates the separation of concerns in front-end web development. This is true and something that you have to be willing to accept to use it.
His proposed alternatives are strange however. He suggests server-side browser sniffing, a bad idea as the article itself explains. Alternatively he suggests using CSS cascading, but this is a bit of a tautology since this is the problem Modernizr was designed to solve.
My personal opinion is that Modernizr is a bit of a kludge, but often the least ugly option available.
Re: Sniff my browser: The Modernizr inadequacy
#5So with the old browser sniffing way, your Firefox 4 user will still get the shiny buttons and rounded corners even if he has no JS. With Modernizr, he'll (at best) get the watered down IE6 version with flat buttons and sharp corners, etc. At worst, if you're not doing progressive enhancement right and you've based critical functionality on one of the injected classes, you might cause some real problems for this user.
I guess I just see this as a limitation of Modernizr, and not a reason to throw out the baby with the bath water. I still love it and use it in all of my projects.
Re: Sniff my browser: The Modernizr inadequacy
#6The two forces are in competition with each other though, because very often the largest group of people are running older technology.
We can broadly divide the potential user base into 3 groups. Those "ahead" with a cutting-edge browser, those with a "modern browser" and those "left behind". Today we'd consider IE6 users and Windows Mobile 6 users as "left behind". We'd consider HTML5 in a late-version of Chrome to be "ahead". Not surprisingly though the vast majority of people are in the middle.
The key question seems to be "Is JavaScript in the mainstream?". I think the answer to that is yes. Even IE6 has Ajaxian capable JavaScript. So therefore is the user-experience, of the many, improved by using JavaScript, to the point where the "few" are sacrificed? In my opinion, yes.
Certainly the user experience is improved immensely with the use of JavaScript. The question then becomes whether it is better to service say 95% () of the market really well, or 100% of the market in a mediocre fashion? I would argue that the market does not reward mediocrity - and the 5% you have gained are the least likely to appreciate your effort anyway.
() pick whichever number here you prefer.
Take an average hotel website for example? It's certainly all-inclusive, but at the same time is horribly unusable. It has evolved since 1995, and it's still as awful as it was then. Does a hotel gain 5% more occupancy for making it all inclusive, or do they lose more than 5% for having a horrible interface?
Personally I don't believe any site is "all inclusive". Those primitive enough to include the bottom end, are too dull for the folk on the top end. So the real question becomes, would you rather have the top, or bottom demographic?
Bearing in mind that for the vast majority the decision to not have JavaScript support is completely their own?
Now of course every site has different considerations. But in my opinion the starting point for the discussion is "how much is that 5% worth?"
Will Modernizr make everyone happy all the time? Well, no. Then again, nothing will.
Re: Sniff my browser: The Modernizr inadequacy
#7Re: Sniff my browser: The Modernizr inadequacy
#8Author discounts modernized entirely because it only works with javascript. Suggests you can replace it entirely by tagging your html tag with an ie class using conditional comments (thereby relying on browser sniffing, after arguing that browser sniffing is terrible and doomed to fail) and the cascade in stylesheets.
I'm not convinced this gives a fair shake to the difficulty of getting graceful degredation right with just the cascade, and any author that says 'x is bad' then relies on x is clearly presenting an incomplete argument.
Re: Sniff my browser: The Modernizr inadequacy
#9Tl;dr: Entire article is nothing but 'relying on js is bad'. Author discounts modernized entirely because it only works with javascript. Suggests you can replace it entirely by tagging your html tag with an ie class using conditional comments (thereby relying on browser sniffing, after arguing that browser sniffing is terrible and doomed to fail) and the cascade in stylesheets. I'm not convinced this gives a fair sha…
Re: Sniff my browser: The Modernizr inadequacy
#10There may be arguments against the modernizr approach, but the ones in the article are quite weak.
[1]: http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Java...
[2]: http://visualrevenue.com/blog/2007/08/eu-and-us-javascript-d...