D
David Mark
MS has finally started to recommend feature detection.
http://blogs.msdn.com/b/ie/archive/2010/04/14/same-markup-writing-cross-browser-code.aspx
It's too bad they are completely clueless about how to go about it.
Their example (slightly modified from jQuery code) is laughable.
If you want to teach feature detection, don't use examples from
jQuery.
And from the comments, this is why the average Web developer will
never understand why browser detection is unnecessary:-
"On IE there exists "navigator.plugins" but it is always empty."
They answered their own objection, didn't they?
Another one:-
http://blogs.msdn.com/b/ie/archive/...sion-quot-and-styling-new-html5-elements.aspx
More jQuery-style object inferences. Lots of valid objections in the
comments, but diluted by typically clueless "answers" like this one:-
"In the case of a recipe like the one Tony posted, it's been found to
work on enough browsers to be quite practical, and it's pretty
simple. "Actually correct programming methods" involve a little
compromise when you just don't know what environment will be running
your code."
Found to work on enough browsers? Empirical evidence does not trump
logic. And the line about compromise is another variation on the
"pragmatism" theme. In other words, if you don't understand the
logic, why not "compromise" and use a mystical incantation.
Oh well, it beats this blog from a Dojo fan:-
http://blog.balfes.net/?p=1312
"Even though Dojo does a great job in making cross browser and
platform JavaScript development very easy there are times when you may
want to do something that is specific for a browser. Instead of re-
inventing the wheel you can use the many functions in the Dojo library
to help with this."
Mentions of "re-inventing the wheel" are a virtually infallible
indicator of a neophyte trying to come off as an expert. Of course,
advocating Dojo is a dead giveaway as well.
I've seen Dojo's browser detection code (which they use internally for
virtually everything, including CSS hacks). It's all UA-based, so if
you really want to use browser sniffing, you could do much better than
Dojo's rendition.
http://blogs.msdn.com/b/ie/archive/2010/04/14/same-markup-writing-cross-browser-code.aspx
It's too bad they are completely clueless about how to go about it.
Their example (slightly modified from jQuery code) is laughable.
If you want to teach feature detection, don't use examples from
jQuery.
And from the comments, this is why the average Web developer will
never understand why browser detection is unnecessary:-
"On IE there exists "navigator.plugins" but it is always empty."
They answered their own objection, didn't they?
Another one:-
http://blogs.msdn.com/b/ie/archive/...sion-quot-and-styling-new-html5-elements.aspx
More jQuery-style object inferences. Lots of valid objections in the
comments, but diluted by typically clueless "answers" like this one:-
"In the case of a recipe like the one Tony posted, it's been found to
work on enough browsers to be quite practical, and it's pretty
simple. "Actually correct programming methods" involve a little
compromise when you just don't know what environment will be running
your code."
Found to work on enough browsers? Empirical evidence does not trump
logic. And the line about compromise is another variation on the
"pragmatism" theme. In other words, if you don't understand the
logic, why not "compromise" and use a mystical incantation.
Oh well, it beats this blog from a Dojo fan:-
http://blog.balfes.net/?p=1312
"Even though Dojo does a great job in making cross browser and
platform JavaScript development very easy there are times when you may
want to do something that is specific for a browser. Instead of re-
inventing the wheel you can use the many functions in the Dojo library
to help with this."
Mentions of "re-inventing the wheel" are a virtually infallible
indicator of a neophyte trying to come off as an expert. Of course,
advocating Dojo is a dead giveaway as well.
I've seen Dojo's browser detection code (which they use internally for
virtually everything, including CSS hacks). It's all UA-based, so if
you really want to use browser sniffing, you could do much better than
Dojo's rendition.