[snip long list of url's]
Congrats on figuring out how to Google search!
That's quite an exaggeration.
Your behavior reminds me of religious zealots who go crazy trying to
No, stupid. You are the one blinded by the light.
shoot holes in evolution and other areas of science. The logic goes
What?!
like this.. "ah HA! This specimen doesn't fit exactly within the
model. If your theory was true, how could you POSSIBLY explain this?
Your THEORY is OBVIOUSLY a pile of JUNK!"
No, stupid. Attributes vs. Properties is on page one of DOM
manipulation. IE6 came out ten years ago. jQuery is supposed to make
getting/setting properties concise, simple, etc. Instead, it makes it
impossible. Not only impossible, but impossible to even *document*.
That would be more than enough right there. But, of course, there is
its opposite and asymmetrical number:
removeAttr: function( name ) {
jQuery.attr( this, name, "" );
if (this.nodeType == 1)
this.removeAttribute( name );
},
So if you have written a script using jQuery, as tens of thousands of
people have, you now have a God-awful mess to debug (whether you know
it or not.) IE8 changed all of the rules for get/set/
removeAttribute. I warned Resig about this (and you too) a year and a
half ago.
You can't glance at anything that includes the attr method and predict
what it will do. Neither can the support group or the developers.
They are all completely in the dark about this most basic and critical
concept. Did jQuery make Javascript work for them?
Here's another lynchpin, which is called every time through the attr
method:
From 1.25:
isXMLDoc: function( elem ) {
return elem.documentElement && !elem.body ||
elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
},
From 1.3:
isXMLDoc: function( elem ) {
return elem.nodeType === 9 && elem.documentElement.nodeName !==
"HTML" ||
!!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
},
Two very different mystical incantations, neither of which was ever
needed. Resig just keeps lopping off the old browsers from his
"supported list" as he is manning a mechanical Turk. Get it?
Never would have had any of these ridiculous mix-ups if he had thought
about these things:
1. Most scripts don't need get/set/removeAttribute
2. Most scripts don't need XML, even when using Ajax
3. Getting and setting properties, with "chaining" requires one and
two lines respectively.
Too late now. The books are written, the examples deployed and the
bloggers are pounding out articles by the day. All to be ultimately
humiliated by the fact that they were pushing something that is
obviously the exact opposite of what they thought it was.
A good judge of a cross-browser script is how often it is altered over
the years. jQuery is obviously grade Z material. Has it added
massive innovation over the years to somehow justify its jello-like
consistency? Of course not. Let us look at what this "simple and
concise" API (that mashes up attributes and properties into one
impossible method) offers:
1. Animations (and not particularly good ones.)
2. "Rich" CSS selector queries, which can be used to pump multiple
elements through the attr method, add styles one at a time or attach
multiple events.
3. Not much else, except an ill-conceived API.
Animations written in Javascript are the wave of the past.
CSS selector queries were never needed, though perversely, through
their popularity, have been baked into the browsers (like animations.)
We know about the attr method (as well as the each method.) An app
that combines those two broken and moving (!) targets to update DOM
properties is obviously unreadable and now unusable. You can't even
explain what the attr method is *supposed* to do after three years of
staring at this shit (and being told it was a non-algorithm.)
Attaching lots of events? We know about that too. One word:
delegation. Not a new concept, except for the "Unobtrusive
Javascript" suicide squads.
Adding styles to elements that match a selector? Hello? Add the
style rule to the head. It's instantaneous and couldn't be simpler.
The alternative is to use a constantly changing blob of regular
expressions per John Resig. Which would you prefer on the eve of an
upgrade?
Speaking of upgrades. The mandatory upgrade to 1.3x has lots of
variables:
1. Browser sniffing -> half-assed feature detection (permeates the
whole script obviously.) Most were IE inferences and IE8 just changed
most of the rules, so you can figure that one out.
2. Attr and its ridiculous XML aspirations. Still broken beyond
belief, but in insidiously different ways in IE. (!)
3. The aforementioned CSS selector "engine" has been largely
overhauled.
Damnit. I just wanted a site that would work in IE8. Now I have to
start over debugging because the whole fucking script has been pulled
out from under me, dusted off and replaced with wildly different
patterns. Are you kidding?
None of this is a mystery. Things were worse (though not by much)
back around 2005. I'm sure people like Sam Stephenson and John Resig
thought they were on to something. Unfortunately, they weren't.
These days, things couldn't be easier. Browser are *not* changing
quickly. Not at all. The only thing changing quickly are the
*libraries*. They change constantly, yet rarely add any sort of
innovation at all. It's all rearranging misunderstood patterns
endlessly, adjusting unit tests to match, etc. They are chasing their
tails. THAT is the ghost in the machine, not the "ever changing"
browsers. Get it?
So, writing cross-browser scripts is simple these days, unless you
were foolish enough to waste three years learning the abstracted
ramblings of neophytes, rather than learning the language. If you
have piled on top of their garbage, you now have no time learn as you
have to go back and scrutinize everything you ever wrote.
Your infinite wisdom has allowed you to find problems in jQuery
(although you rarely specifically identify them, but rather
You know that is untrue. I handed you the solution to the attr method
in the Fall of 2007. I've documented hundreds of issues with jQuery
in the last year or so. Have you been away?
just throw
your hands up and type some insult and point to a code snippet like
someone pointing to an odd fossil), to find fault in its author, and
Rubbish. You are referring to cases where the analysis has been
repeated so many times that it doesn't need further explanation. Or
maybe you are still trying to figure out the ActiveX "brain-teaser"
from a week ago (hint.) Your perceptions are just not reality, just
as you anecdotes are not evidence.
to find weaknesses in its ticket system and support forum.
They aren't hard to find. Where are the strengths?
Congratulations. You have learned that no software is perfect, no
author has it all figured out, no development process is ideal, and
But, stupid. *Lots* of people had cross-browser scripting figured out
in 2003 (or so.) It's 2009. April of 2009. IE8 just came out, lots
of sites are broken. Lots of neophytes now have to debug their attr-
intensive scripts. So, stop spouting generalized nonsense.
the problem of "browser scripting for the masses" is a very difficult
problem to solve. Perhaps next you will astonish the world with your
revelation that Santa Claus is not real and the moon is really not
made of cheese. Thank you, Captain Obvious!
Sad.
You know, I've developed some pretty shitty code in my days, and I've
And some pretty shitty superstitions. How does the song go? When you
believe in things you don't understand, you suffer.
followed development patterns that I now know are amateurish and a
Are you a duckling or a programmer?
waste of time. And I've done most of it in the public eye, releasing
So?
much of my work for the world to use, judge, and criticize. A lot of
Again, so?
it is still out there. It's been helpful to me, and helpful to others.
Ugh.
I'm sure you could easily find code I've written that is horrible, and
Find?
you could rip me to shreds too. But what's the point?!
Could?
Who cares?
Nobody. That's why I don't bother.
Everyone is learning as they go, and perhaps following a few wrong
roads or two - including Mr. Resig. But at least he's willing to stick
Here we go again.
his neck out, face the criticism, and spend hours and hours trying to
improve his code and help thousands of developers around the web.
He's helped nobody. He's harmed more than you can imagine.
Meanwhile, you spend hours and hours criticizing and making fun of
Hours and hours? If you add it up over the last year, perhaps.
people, continuously trying to knock people down rather than build
them up. You're a negative, critical, mean-spirited person. You wonder
why people line up behind something like jQuery? Because jerks like
Because of lunatics like you.
you are miserable to be around, and most of us will accept the flaws
That's odd, my clients love me. You, of course, have never met me.
in jQuery before we would be associated with someone like you.
Associated with someone like me? Did you pick Windows because you
wanted to be *associated* with Bill Gates, rather than Steve Jobs?
You are mad as a mongoose. All of these histrionics over a 50K script
you could rewrite from scratch in a few days. I could do it in *one*
day, but I don't want it.
jQuery
will continue to improve and people will continue to benefit from it,
No, the constant "improvements" are the rub. It isn't a good thing to
do wholesale script replacements on Websites, especially not with the
collaborative chaos that is introduced in a project like jQuery.
...
read more »