Richard, as always your analysis is detailed, analytical, accurate,
and insightful (and long).
I wish I had someone at my disposal to review my work in such detail.
Surely you recognize that there are few people who would be capable of
such an analysis.
John Resig is very keen to speak of the 3 or 4
recent desktop web browsers that JQuery actually does support as "all
browsers", and when you are fully supporting "all browsers" the result
must then be cross-browser.
I think the most valid non-technical criticism of jQuery is that it is
promoted as being a generalized solution that is applicable to most
(or all) public web sites. It is not. But must we continually repeat
that fact as if it completely invalidates it as a tool for other
purposes?
Libraries such a JQuery allow people with little or no experience in web
development to crate sites that, on a limited number of web browsers, it
there default configurations, appear to 'work' and present a (more or
less) impressive presentation. But these people have no understanding of
the consequences of their actions (indeed mostly seem unaware that there
are any issues arising from their decisions at all).
This is true of many things in life, not just jQuery. You just happen
to be an expert in the area that jQuery addresses and can see its
faults. Technical perfection is NOT the only measure of success or
evaluation criteria.
Take a retail situation as an example. A store may not be able to
accept all forms of payment, thereby limiting their potential
customers. They may not be open at convenient hours, further limiting
potential customers. They may not have adequate parking. Maybe some of
their products are out of reach of some customers. Maybe they have
shopping carts that fit most people, but some find inadequate so they
leave. Maybe their store layout is too confusing so some people leave
because they can't find what they want. Maybe their sales tactics are
obnoxious and they annoy customers so much that they walk out.
BUT WAIT! Don't they know that each of these things is a design
decision that could prevent a small percentage of potential customers
from giving them money?! Why don't they fix them all and optimize it
so every single person can use their store and buy as much as
possible?
Why? Because it's made by humans, and humans aren't perfect. Sometimes
you have to say "close enough" and get on with it. If a site "appears
to work" for most people, and the customer finds it acceptable, and
even if they lose out on a small percentage of potential sales, maybe
that is truly "good enough". Maybe they can't afford to do it exactly
right. Maybe the analysis and perfection of the system just isn't
warranted, because with just a little effort they can get a lot of
business, and that more than makes up for the potential losses of
customers. That's the real world.
This, oft repeated, assertion that the only alternative to using a third
party general purpose library is write everything from scratch for
yourself is a total nonsense.
It's not black-and-white to you, but to others in different situations
it just might be, because they don't have the same options as you do.
In-between those two alternatives lay a
whole spectrum of code re-use opportunities
You are in a position to determine that because you have a good
understanding of the technology. You criticize jQuery because it
doesn't handle all cases and has design flaws that may impact a public
site that is using it, because its developers are too naive to know
the pitfalls of the library. But then you expect these same naive
developers to understand how to develop, test, modularize, and re-use
their own code as a better option?
From my own experience; when IE 7 was released I was working on a web
application with (at the time) 100,000 lines of client-side code (code
employing nothing but feature detection where it is necessary to react
to divergent environments).
You realize that this kind of example shows that you are at the very
extreme edge of js development? You are very clearly not the audience
for jQuery or any other popular library approach. I suspect you have a
hard time relating to the average developer who is struggling just to
do simple animations or toggle divs.
And last week QA started testing that application on IE 8.
And do you know how many projects even _have_ QA departments? Consider
yourself lucky to work in such an environment! You are the exception,
not the norm.
Now that is "Future Proof" javascript, and low maintenance javascript.
Planned, designed, and written by an expert in the field. We just need
everyone to be experts and all this discussion would go away!
While you may conclude that the reaction to the self proclaimed
"JavaScript Ninja" on this group is biased and personal, in reality it
is mostly a direct reaction to what he writes/does, and a reaction
informed by pertinent knowledge and experience in the field of browser
scripting.
From my perspective, John Resig is clearly not as knowledgeable and
experienced as you are with regards to Javascript. But, whether you
like it or not, he has much more knowledge than the vast majority of
people attempting to write Javascript. He's not perfect (who is?) but
he's out there, sticking his neck out, showing his cards, sharing what
he knows (or thinks he knows). That takes a lot of guts, and I'm sure
he's learning along the way. If everyone needs to be an expert at your
level before they can share anything they know, no one would be
learning!
The developer world needs people like him, and libraries like jQuery,
to bridge the gap between the average user who is lost and confused,
and the expert developer such as yourself. You may not think that
jQuery is a positive thing in the scripting world, but countless other
people disagree with you, and things are moving in that direction
whether you like it or not. Even Microsoft (not your biggest measure
of success, I'm sure) has adopted jQuery into its development
platform. Surely this doesn't affect how you do your work. But you
need to recognize how it changes the game for the rest of the
developer world.
It seems that your perspective prevents you from understanding the
needs of people who are in a very different situation from yourself.
And if you want to have a more positive impact on the scripting world,
you need to learn from people like John Resig just as much as he needs
to learn from you.
All IMO, of course.
Matt Kruse