See, you're bundling them all together. I felt exactly the same way about
As well they should be.
JavaScript libraries until I started looking further into jQuery. So, you
You sound exactly like one of those breathless bloggers that promote
the user of this junk to "solve" Javascript.
can actually assume that for the most part I agree with you regarding the
other libraries. But all the arguments I've been reading against it just
sound like people who don't know anything about it. I've looked through the
source, not in detail, but enough to feel good about it.
Then you are utterly incompetent to write about Javascript, let alone
write it. Please stop doing both things until you get a handle on it.
Core jQuery is 17KB gzipped - a single medium sized medium quality photo is
bigger than that
GZIP sizes are the favorites of library proponents as they make
something large sound like something small. Hint: not every agent
accepts GZIP.
Have had no problems with core jQuery, admittedly I haven't used a lot of
LOL. You have a big problem with it if it is on a public server.
the plugins. Of course, it's not bug-free, no piece of non-trivial software
is, including the code that you or I or anyone else writes. But the project
But it is fairly trivial (and buggy as hell.)
is mature and they have a reputation for fixing bugs quickly.
OMFG. Where have you been?! Not in the Javascript group, that is for
sure.
It uses object detection, and internally the sort of thing it uses it for is
stuff like providing an abstracted event model that works across IE and
browsers that support the standard event model, that sort of thing.
No, it mostly relies on browser sniffing for such things. You can
take it to the bank.
To reduce size. Given that it's GPL licensed, why would they want to
obfuscate it?
They do it so it sounds like it is less code than it is. Make no
mistake, it is a full 80K-90K of (very bad) Javascript and guaranteed
to blow up virtually any user agent, save for IE, FF, Opera or Safari
(in their default configurations of course.) I heard somebody mention
that some of it worked in Chrome, which *proves* browser sniffing is
viable (don't ask me), but of course Chrome spoofs Safari (and as it
diverges from its Safari roots...)
The jQuery minimized release isn't tokenized, just comments and whitespace
removed - taking the core from 98KB down to 54KB. Gzipping on the server
reduces this down to 17KB.
There we go with the GZIP sales pitch again. Any way you slice that
script it sucks. End of story. I don't care if it is -1K.
You can develop against the non-minimized version with proper whitespace and
comments and then deploy the minimized version on release.
That might be the most idiotic programming advice I have ever heard.
Sure, develop and debug against one script and then release a
different one. And this is the sort of things you will hear in that
jQuery support group (the blind leading the blind.)
I always have in the past. The thing is, using jQuery, I can generally do
the same thing in a fraction of the time. My time is too important to hand
It is easy to save time by taking shortcuts.
craft every little thing, and I don't find any of your objections compelling
enough to think that it's worth spending a day or more writing something I
could do in a couple of hours with jQuery just to avoid having to include a
"mammoth" 17KB of gzipped JavaScript.
You don't seem to comprehend that it is also about quality. That 17K
(!) of script is excluding people from your site(s). And what are you
going to do when it breaks? Quick! Get me John Resig! LOL.
Have you looked at it at all? You realise that the core is just a framework
You had better believe it.
that let's you, as you say, roll your own, just in a more efficient manner?
What is this "roll your own" stuff? Hint: you didn't need to query
the DOM by CSS selector in the first place. I never do.
What you're advocating is like using Java but ignoring its class
libraries... that's all jQuery is, a framework. There are lots of
Would you use class libraries that were written by Java neophytes and
full of mistakes?
additional plugins for it, sure, but they're mostly third party. You don't
have to use them, and indeed, I generally don't.
Those things are beyond jQuery in terms of incompetence. They are
written by the jQuery "crack babies."
The most useful thing for me is that it lets you select and manipulate the
DOM using CSS3 selectors*, which is extremely powerful. For example, zebra
striping all tables on the page:
Dear Christ, you don't need CSS3 selector queries to "zebra stripe" a
table. As a matter of fact, you don't need script to do that at all.
$("table tr:nth-child(even)").addClass("striped");
Now we see the incompetence inherent in the system.
How many lines of JavaScript would that normally take**?
How about 0? And how many unneeded function calls does the above
normally take, with re-flows in between as you are fiddling with the
classes. That miserable $ function is outrageously inefficient on its
own (and looks like a variable to noobs) and the whole library hinges
on it.
If you're writing a lot of JavaScript then suddenly you find that it doesn't
take many cases like this to make bigger savings than the 17KB you're giving
up.
Even if that were true (which it isn't), it wouldn't have any
bearing. And enough with the 17K already. It's *not* 17K.
[snip]