On Jan 27, 11:12 am, Karl Swedberg <k...@englishrules.com> wrote:
> I really appreciate your knowledge and your passion regarding feature  
> detection. You've definitely given me a lot to think about in this  
> thread.

Thanks, I think it's an interesting discussion. I apologize if I come
across "preachy", btw. My interest is purely technical and I have an
interest in making jQuery more robust and solid, since I rely on it
daily.

If you search the archives of comp.lang.javascript, I've had this war
many times there (I can't believe I've been writing js for over a
decade...) and have slowly adapted my thinking. I look at my old code
compared to what I write today and it's embarrassing! I understand the
hesitation from many people to adapt true feature detection
techniques, and the desire to hold on to existing ways that "seem" to
work correctly. But there is a better way, and it opens the door to
wider browser support, less concern about browser versions and new
releases when browsers get updated, and fewer bugs and quirks in code.
I am still amazed at the ways that some of the experts in c.l.j.
approach problems with FD and solve them in a very generalized, robust
way.

> In the case of jQuery core, one of the biggest accomplishments of  
> version 1.3 was that it eliminated browser sniffing in favor of  
> feature detection. Are "the techniques being used" in the current  
> version still problematic? And, if so, how?

The currently-used techniques are an improvement, but are not what the
"spirit" of feature detection is all about. The current implementation
seems like kind of a twisted version of FD, and one that is not as
robust as it should be.

I go into some details here:
http://groups.google.com/group/jquery-dev/tree/browse_frm/thread/5e87613fc36ff7bd/90808be61349b42c?rnum=11
and here:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/b9a5c81d3d683020

Basically, the current logic in some places is:

if (standards_supported)
  use_standards_method()
else
  apply_ie_fix()

This is short-sighted, and only logically sound if you limit your
browser set to a specific number of common browsers. As a general
approach, it fails and is not logically correct.

Feature Detection is all about checking how a feature behaves, and if
it behaves in a known faulty way, then apply the known fix. Instead of
checking whether browsers "support" each of the standard way of doing
things, the detection should be checking for known failures that need
fixing. Knowing that a browser does not support a standard way of
doing something does _not_ logically tell you the correct way to fix
it. You need to test to see how the feature behaves to know which fix,
if any, is most appropriate.

Matt Kruse

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to