D
David Mark
Thanks for your thorough and interesting reply. I agree with much of
what you wrote, so I'll focus on the direct questions.
[e-commerce sites] Every time someone in that set is excluded from
the group from whom money can be taken that is a direct result of a
design decision. [..]
So we come to trade-offs; is the increased turnover that will result from
a more professional presentation greater than the loss in turnover that
may result form designing out the possibility of the user of some
browsers from accessing the site at all? How do you make those
judgments, and who should be making those decisions, and based on what
information, knowledge and experience?
This boils down to the question which user agents an application is
designed to support, and who makes that decision. Only the client is in
a position to decide who to shut out, and he will (or should) base this
decision on his customer base, collected browser statistics, and the
Browser statistics?! Are you kidding?
advice of his technical staff and developers. Amazon will reach a
different conclusion here than, say, YouTube, or a gaming site, or a
They are both public Web sites. The idea that they should make a
conscious decision to "shut out" users is absurd.
portal for Ajax fans. Dropping support for ancient user agents can help
As long as the documents are still usable in those ancient user
agents, then that is fine. But you *cannot* degrade gracefully
through browser sniffing. End of story.
keep the code base managable and reduce the maintainance effort. I would
The last thing that adding a browser sniffing script like jQuery to
your app is going to do is save on maintenance. Scripts like that are
patched to death, so trying to keep up with the ever-changing browser
landscape is an exercise in futility. The more workarounds added to
"fix" unit tests, the worse it gets. Try to remove any of these
patches and the whole thing unravels. And you are going to delegate
these tasks to people who do not understand the first thing about
browser scripting? That is not a sound strategy.
never say that JQuery is suitable for any site; but for some sites the
target audience will be overwhelmingly likely to use one of the browser
versions that JQuery supports.
Absolute rubbish. And even on an Intranet where one configuration of
IE is used, it is still a poorly designed, inefficient and ugly piece
of code. Does that sound like something you want?
For personal sites, the owner gets to decide. A private blog, for
example, would be much less affected by the reactions of the <1% of
visitors whose user agent isn't in JQuery's list.
But there are so many other options out there. What is the
fascination with this crappy little script from three years ago?
Anyway, I wasn't trying to recommend or defend JQuery, I was only
talking about the linked articles.
Instead, you should have been reading the linked articles. If you
didn't follow, then you should have searched the group for the links.
All of this is re-hash.
Perhaps so, but where *is* all that pre-written and tested code? Every
These discussions always devolve into a demand for "pre-written and
tested" code. To have pre-written code, you have to have written some
code at some time that is re-usable. If you don't have that, it is
likely because you have been cobbling together bits of other people's
code.
time somebody asks for a good library (as in collection of code that
helps to deal with browser quirks and incompatibilities), they're told
that there is no such thing. If they dare to mention one of the popular
You know that is not true. In general, general-purpose browser
scripting libraries are a bad idea. Collections of code (good code)
are not a bad idea and have been published (here and other places) by
numerous contributors.
libraries, they get flamed to cinders. If such a collection exists, I
Public contradiction of dubious advice is invariably referred to as
"flaming" by those whose "sensibilities" it offends. If you had spent
months or years in the comfort of your own little vacuum, writing
browser scripts to great accolades from your peers, and then find
yourself summarily contradicted in the real world, it is likely to be
an unwelcome shock. You can react one of two ways (think again or
complain about some perceived hatred and flaming.)
would very much like to know where to find it.
Didn't we just have this discussion?
(snipping your test cases) You're right. I had already tried to
duplicate the problems mentioned by Resig and couldn't reproduce them
either. Maybe the errors only happened with very obscure configurations,
See my post on the subject. It is a behavior that I stumbled upon
years ago. I never wrote a blog entry about it, but I have posted
about it numerous times in this group. John Resig stumbled on the
same thing, failed to understand it at all, and posted his comedy bit
about phantom calls to getAttribute.
or maybe he's just wrong. Who knows. It doesn't really matter though,
He's just wrong. With him, that is virtually always a good
assumption. Never mind how many idiots in the publishing industry
think otherwise.
because the point was that object detection isn't a cure-all for
cross-browser scripting, and I agree with that.
He had no point and therefore proved nothing.
Probably. Still, using bad (or let's be nice and say unreproducible)
No, bad.
examples doesn't necessarily invalidate the main focus of the article,
Certainly it does. The whole thing is an attempt to justify his own
incompetence. The Prototype people have published similarly ill-
conceived rants (my favorite involved the display style.) You have to
wonder why anybody would trust code from any of these "programmers."
I wouldn't take a batch file from any of them, let alone a script that
might turn users away from my site. (!)
or at least the point that I found interesting - which is adding the
JQuery test suite to the Mozilla test suite. It's *possible* that a new
Worthless as jQuery is almost entirely hinged on user agent
detection. Think about that.
browser version could introduce bugs like the ones Resig used in his
examples (even if they didn't exist now), or uncover bugs in the JQuery
library. Testing a browser with a widely used library is a good thing.
See my numerous posts on feature detection and testing. Peter
published a nice blog entry on the subject as well:
http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
(though the CSS seems to be malfunctioning!)
That's very impressive. In an application of that size, I'd expect to
find issues even without accounting for new browsers. I assume that your
Your expectations are set realistically low. I would expect much the
same from your code at this point (you have a lot to learn.)
requirements are vastly different from those who want to build a flashy
site with moving objects and whistles and bells.
Irrelevant. You don't get more "whistles and bells" than the project
I have spent the last half year on. Yes, moving things, special
effects, etc. can be future-proof (sure as hell not with jQuery
though!)
Looks like he was on the wrong track with his test, and you're the first
He was in the wrong rail yard.
person who's figured it out... (and the quirk looks even weirder now).
I'm not about to defend his misjudgement, I just don't think he took it
That would be difficult. He doesn't do it, so why should you try?
very seriously. He probably considers himself part of the "Web 2.0
wave", whatever that is, so he tossed out a blog entry about a curious
Ah yes, "New Wave JavaScript." He is part of a new wave of
incompetent programmers who insist on "teaching" others how to do
everything in the worst possible way.
quirk without much research, to let the community figure it out and play
with it. I really don't think this could or should be used to discredit
him. What he does in his library is a different matter.
He writes code as he writes blogs (incompetently.) What should he get
credit for? Exhorting and enabling hordes of incompetent Web
developers to add browser scripting to their acts?
As I said, I'm still convinced that checking browser types/versions
can't always be avoided. But since both you and David say that it not
Give me one example where it absolutely *cannot* be avoided.
only CAN be done, but HAS to be done, I'll try a little experiment and
ask the group whenever I'm tempted to write [if browser is MSIE6]. If I
can find solid cross-browser solutions for these problems, I'll gladly
retract my statement.
Then you are a better man than John Resig.