M
Matt Kruse
When I propose a library to a client, they want to see something
well-known and widely used, and I have some understanding for
that. Since they cannot judge the thing itself, they have to
judge "by proxy".
I have the same experience. Some clients have an "approved" list of
3rd-party libraries that may be used. Even if I wanted to use "My
Library" instead of jQuery I couldn't.
I keep thinking about a partly or mostly compatible jQuery
replacement, something that would look superficially like
jQuery, but would work better under the hood.
The idea would be to point out jQuery's shortcomings, but at the
same time offer jQuery users a very simply upgrade path. The $
name makes this particularly easy, as people would not have to
change their jQuery-based code.
I have wanted this for a while. In fact, I own myjquery.com which was
going to be for that purpose. But I have never done it.
The main argument against this is that it's the jQuery _concepts_ and
core API that are flawed. Not just some of its internal workings.
The overloading of functions, in particular, is seen by many to be bad
design. And if you want to replicate the flawed API, you're going to
end up in the same traps that jQuery is criticized for to begin with.
I think it would be good to strip down the API to be reasonable and
offer less functionality than the default jQuery. Make it the selector
engine (which I also find very useful) with some commonly-used core
functionality on top of it. Remove half the methods and remove the
overloading from the other half.
A lot of existing jQuery code probably wouldn't work with the new
library, but that wouldn't be the point. Instead, you'd have a better
starting-point to work from, and a smaller learning curve to go to a
leaner, faster, more robust library. Plugins would very likely not
work, but that's a good thing. Almost all jQuery plugins are junk
Matt Kruse