I see your point, but the fact remains that jQuery is incredibly
popular, rightfully or not.
So was Disco.
Trust me when I tell you that it is on its way
(rightfully) down the toilet. Have I been wrong yet?
"Aping" their API is the only chance
to let users easily and directly compare and find what works.
Not really. TaskSpeed is a good example. Of course, when jQuery came
in dead last (by fifty lengths at least) and the rest of the pack
finished a mile behind the "pure" baseline, I heard ugly "Real World"
murmurs creeping in (e.g. the "pure" solutions were somehow
cheating). Some people will see what they want to see, regardless of
reality (see Matt Kruse)
While I assume you are right about all the technical basics, you
may still be overlooking how attractive the jQuery API is for
beginners, probably also for intermediate programmers, and those
are the ones that matter a lot for the market situation.
There's exactly two attractions for the dull and duller set:-
1. Querying by CSS selector
2. "Chaining"
#1 is arguably not a good interface for DOM scripting, but that's as
maybe. Virtually every browser that jQuery "supports" has it built-in
now (QSA, and it simply isn't compatible with jQuery).
http://www.cinsoft.net/queries.html
#2 was always built into the language. Put this at the end of your
method calls:-
return this;
So, it's pretty much over for them for all but the hopelessly deluded
who will eventually self-destruct (like all die-hard cult members).
The same goes for any "cross-browser" script or framework stupid
enough to "support" one wave of browsers at a time (e.g. the latest
major desktop browsers). They are now hopelessly swamped,
particularly those still stuck in the decade before last (sniffing the
UA string).
Forget about the inefficiency. For most typical jQuery
applications it just does not matter, and for the fewer web
sites where jQuery's inefficiency does matter, one can still
offer alternatives.
You are completely wrong. jQuery can be hundreds and even thousands
of times slower than a competently written, context-specific script.
It's outrageous what these "code monkified" sites do to my PC's. And
for what? Most of them don't do anything special at all.
And when responding to user input, scripts need to be as fast as
possible. This is particularly true on mobile devices (which jQuery-
fied sites needn't worry about as they will typically just blow up at
the outset).
Yet another reason is the huge amount of existing jQuery code.
It's all shit. By definition, it would have to be. Don't listen to
idiots who use those "nothing is perfect" or "just being pragmatic"
argument to try to explain away core issues. When the foundation
(reading element attributes and dimensions, viewport measurement,
input monitoring, etc.) shifts _constantly_ (usually because of
incompetence on the part of the authors), it topples the efforts of
the neophytes building on top of it. Then what do _they_ do? See the
various support forums to find out. The end result is typically to
try to replace it with a newer (or older) version, which is a non-
trivial proposition, even for experienced developers with support from
solid QA testers (hardly the norm). Phew! And what if it still
doesn't "work?" Do you see how you could never rely on plug-ins or
anything else written by a third-party jQuery "programmer?" And
there's no system to keep track of compatibility for any of it.
Software just doesn't work like that, even on the desktop where it is
a _far_ easier proposition to wing it.
Only a compatible API can lever that.
You need a shovel for that pile, not a lever.
By the way, I would redefine jQuery's .attr(…) method to work
only with properties.
Yes, explaining that (or anything for that matter) to the deluded
authors (again, see Matt Kruse).
http://groups.google.com/group/jquery-dev/browse_thread/thread/baef5e91bd714033#
It's a cargo cult. Resig's idea of "test-driven development" is to
use tests not to confirm his designs are implemented correctly, but to
shape his designs. It's mixed up and nobody can seem to convince him
otherwise (after three years). He's just a rotten programmer with
abysmal problem-solving skills (and virtually no real experience with
cross-browser scripting) who (unfortunately) stumbled upon success and
adulation from people who don't know any better (e.g. Web
developers). It's retarded whatever development he might have been
capable of. Bit of a loud-mouth too. As for his die-hard followers,
some of them seem genuinely retarded to me.
Wouldn't you have to
be at this point, at least mildly?
For the most part they have done that
themselves already, so the misnomer will have to stay.
Um, it's still a bizarre hybrid last I checked. It throws exceptions
for some attributes, reads attributes for others, steps on still
others and reads straight properties for the majority. It varies from
one version of jQuery to the next and the behavior changes _radically_
in IE8 on clicking the compatibility mode button (which sort of
simulates IE7), which is a large button right next to Refresh. Do you
see the problem with this?