On Oct 29, 12:42 pm, David Mark <dmark.cins...@ gmail.comwrote:
Run it through JSLint.
Which is about as useful as validating HTML. Great for academic
purposes, perhaps it will catch a few errors, etc.
But in the end it doesn't matter if code passes analytics, just if it
accomplishes the goal or not. My goal never includes "pass
validation". Validation is merely a tool to reach my goal, when
needed.
Then search it for "userAgent. "
Browser sniffing is not encouraged, and in some cases in jQuery it is
really unnecessary. There are cases where it is beneficial.
Rather than writing lengthy logic to solve for every possible case,
you can write shorter logic to solve for a subset of cases you care
about.
It's not ideal, but it is a strategy. The amount of browser sniffing
in jQuery is minimal.
Then look at the logic that tests for a function.
It may not be perfect, but have you ever come across a real-world case
where it has failed for you?
Me neither.
How is it beneficial to swap one's own terrible code for the terrible
code of another. Is it easier to debug somebody else's code?
jQuery's code is not terrible. It is a substantial improvement over
most javascript code written by average developers. In my experience.
There is a minified download option. Check it out.
Isn't that what I said? Running it through a minifier will lose about
30K. I just tried it here and my estimation was almost exactly right.
The packed version is 26kb. Plenty small.
Having recently looked over the code, I can tell you it is poorly
written and full of mistakes.
Without any examples or real critiques to back up that broad
statement, it's worthless.
Try searching this very newsgroup for jQuery. You will find lots of
examples.
But why should I look up past examples? You said you recently looked
over the code and found that it was poorly written and full of
mistakes.
Surely you could provide some examples from your recent investigation?
I've been writing javascript for over 10 years, and I've seen poorly
Lots of people can make that claim. How many of them are competent to
script browsers?
I'm not sure "lots of people can make that claim". I consider myself
to be very knowledgeable about Javascript development, and I disagree
with your conclusions. Surely not everyone who disagrees with you is
categorically an amateur?
written code. jQuery is not poorly written. Nor is it "full of
mistakes".
Then despite your vast experience with JavaScript, you still don't get
it.
What don't I get? You are not providing any actual arguments. You
might as well just say "You're stupid!" and stick your tongue out.
Further, have you considered that perhaps it is you who just doesn't
get it?
Would you also throw out the Wikipedia as "junk" because you find an
article with technical errors?
That is an odd comparison.
Perhaps. The point is, just because you notice a few flaws in
something does not mean it is worthless. It merely means it has flaws.
Which means it was probably developed by humans. If your goal is
perfection, you'll never find it.
My real-world experience differs from your hypothesis. I can measure
the _huge_ benefits of using jQuery in real dollars, and it is
significant.
And how would you quantify the benefits of "using jQuery" in dollars?
#1:
(Previous time to develop functionality) - (current time to develop
similar functionality) = Time Savings
Time Savings * Pay Rate = Money Saved
#2:
(Number of JS bugs before) - (Number of JS bugs now) = Bug Savings
(Bug Savings) * (Avg Time to Fix JS Bugs) * Pay Rate = Money Saved
Consider the effects of introducing jquery to a large development
team:
1) Reduced time implementing similar functionality as before
2) Reduced number of bugs
3) Improvement of UI because developers have access to pre-made
plugins
4) Less time needed to write functionality from scratch and research
browser quirks
5) No problem reports from any end users
Now, how are you arguing that using jquery is not a huge benefit?
You would recommend that we stop using it and start coding from
scratch?
I'd love to hear about your experience with jQuery and the maintenance
Having read the script, I concluded it was worthless. Therefore, I do
not use it.
Then how would you know anything about an increase in maintenance
caused by using jQuery?
Can you quote the experience of anyone else who has used it and found
it to be a maintenance problem?
Or hell, can you quote anyone who has used it and found it to be a bad
decision for any reason?
Do you have any real-world experience with it?
If not, how do you possibly feel justified in criticizing it?
Matt Kruse