From: Gregor Kofler on
lorlarz meinte:

> This might make a lot of JS people here mad, but I _want_ to use
> jQuery. I just want to have all assurance or reasonable
> quality control. At the very least, jQuery is very close to
> OK. I just really want to know if there are any _real_ errors
> that make things work wrong.

JSLint won't tell you anything about code quality. Well, at least not
much. JSLint won't tell you anything about efficiency of scripts. It
can't tell you anything about *browser* scripting (it's not interested
in host objects). It won't tell you whether the script being checked is
up to the task it was written for.

Even if scripts don't pass JSLint they can be perfectly ok (which
doesn't apply to jQuery) - one just has to understand the warnings issued.

Gregor


--
http://www.gregorkofler.com
From: john on
On 01 Mar 11:46 AM, Gregor Kofler wrote:
> (After all Internet Explorer 6 is still the
> most popular browser on this planet's face...)

according to what statistics? fortunately all of the references i looked
at (those linked from the wikipedia page on browser usage) contradict
that. checking the logs for 15 client sites (none of which are tech
oriented) i see a similar pattern of IE6 being anywhere from 3rd to 5th
most used browser.

http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2
http://www.w3counter.com/globalstats.php?year=2010&month=1
http://gs.statcounter.com/#browser_version-ww-monthly-200902-201003
http://www.w3schools.com/browsers/browsers_stats.asp
<http://statowl.com/web_browser_usage_by_version.php?1=1&timeframe=last_6&interval=month&chart_id=4&fltr_br=&fltr_os=&fltr_se=&fltr_cn=&limit[]=ie>
From: Gregor Kofler on
john meinte:
> On 01 Mar 11:46 AM, Gregor Kofler wrote:
>> (After all Internet Explorer 6 is still the
>> most popular browser on this planet's face...)
>
> according to what statistics? fortunately all of the references i looked
> at (those linked from the wikipedia page on browser usage) contradict
> that. checking the logs for 15 client sites (none of which are tech
> oriented) i see a similar pattern of IE6 being anywhere from 3rd to 5th
> most used browser.
>
> http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2
> http://www.w3counter.com/globalstats.php?year=2010&month=1
> http://gs.statcounter.com/#browser_version-ww-monthly-200902-201003
> http://www.w3schools.com/browsers/browsers_stats.asp
> <http://statowl.com/web_browser_usage_by_version.php?1=1&timeframe=last_6&interval=month&chart_id=4&fltr_br=&fltr_os=&fltr_se=&fltr_cn=&limit[]=ie>

Indeed. On statcounter it currently occupies the second place...
If you look at Europe or perhaps Germany the situation improves further.
It was just the usual reply, when someone tries to rate the "quality" of
product by its widespread use and acceptance.

Gregor


--
http://www.gregorkofler.com
From: Stefan Weiss on
On 01/03/10 20:22, lorlarz wrote:
> On Mar 1, 12:45 pm, lorlarz <lorl...(a)gmail.com> wrote:
>> You may be interested to know that in response to this JSLint barrage
>> (which I have also contacted John Resig personally about), John
>> has decided to make a couple of changes and is considering making
>> a couple (or some) others. The following links, provided by J. Resig
>> supposedly have something to do with 2 changes made so far:
>>
>> [snipped mangled link]
>>
>> He also said he has one thing to investigate and another he is unsure
>> of.
>> Also: It is also noteworthy that at least one of the errors cited
>> by JSLint was seen as a real error _needing_ fixing.

That's just a missing semicolon. It's not an "error _needing_ fixing"
(in this case), and John Resig didn't say it was. It's good style to add
the semicolon even if it's not strictly required, that's all.

>> John Resig encourages people to keep up on any changes by getting
>> the most recent release always:http://code.jquery.com/jquery-nightly.js
>>
>> I shall not pass any judgement on any of this.
>
> P.S. John adds that he has also made this fix:
> http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c51168e816073
>
> Unfortunately, he will not participate here

I'm not surprised.

> and has basically insisted
> that these issues be discussed in the following forum:
>
> http://forum.jquery.com/developing-jquery-core

Looks like the logical place for your report. Apparently Resig has
already fixed many of the minor issues you mentioned, and decided to
look into some others. I wouldn't worry too much if JSLint still comes
up with some "problems" after he's done; not everything it finds is
actually a problem.

JSLint has always had its little idiosyncrasies. It doesn't check
syntax, it checks code style - and in the absence of official style
guidelines (like they are used in many companies and projects), you'll
have trouble getting any two developers to agree on a single set of
rules. JSLint uses the subset of JS that Crockford has defined in his
book as the "Good Parts", and a number of other rules which he considers
important.

Unfortunately, not all of these rules make sense for everybody, and many
of them are hardcoded. The regex lints you posted are a good example:
JSLint will complain about something like /[ab-]/ ("Unescaped '-'"), but
there's nothing wrong or ambigous about it. Adding escapes where none
are necessary is, IMHO, the opposite of good style. There are many other
examples, like the inability to call functions in a line earlier than
their declaration, the inevitable warning if functions are created in a
loop, and more regex hysteria.

To the best of my knowledge, there are no alternatives to JSLint, so we
have to take the good with the annoying, or do without a lint checker.
The JQuery team has decided to go with the latter option, which is
understandable, but it made them miss some of the issues you pointed
out. Personally, I usually just roll my eyes and change a few characters
to make JSLint happy, or use a wrapper script which lets me insert
inline comments to suppress JSLint output.

So, I don't see a problem with JQuery not passing JSLint. If you trust
the JQuery developers to write the code you're using, you might as well
trust them to decide which JSLint problems are worth fixing (as long as
they're aware of them, which they now are).


--
stefan
From: lorlarz on
On Mar 1, 4:29 pm, Stefan Weiss <krewech...(a)gmail.com> wrote:
> On 01/03/10 20:22, lorlarz wrote:
>
> > On Mar 1, 12:45 pm, lorlarz <lorl...(a)gmail.com> wrote:
> >> You may be interested to know that in response to this JSLint barrage
> >> (which I have also contacted John Resig personally about), John
> >> has decided to make a couple of changes and is considering making
> >> a couple (or some) others.  The following links, provided by J. Resig
> >> supposedly have something to do with 2 changes made so far:
>
> >> [snipped mangled link]
>
> >> He also said he has one thing to investigate and another he is unsure
> >> of.
> >> Also: It is also noteworthy that at least one of the errors cited
> >> by JSLint was seen as a real error _needing_ fixing.
>
> That's just a missing semicolon. It's not an "error _needing_ fixing"
> (in this case), and John Resig didn't say it was. It's good style to add
> the semicolon even if it's not strictly required, that's all.
>
> >> John Resig encourages people to keep up on any changes by getting
> >> the most recent release always:http://code.jquery.com/jquery-nightly.js
>
> >> I shall not pass any judgement on any of this.
>
> > P.S.  John adds that he has also made this fix:
> >http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c5...
>
> > Unfortunately, he will not participate here
>
> I'm not surprised.
>
> > and has basically insisted
> > that these issues be discussed in the following forum:
>
> >http://forum.jquery.com/developing-jquery-core
>
> Looks like the logical place for your report. Apparently Resig has
> already fixed many of the minor issues you mentioned, and decided to
> look into some others. I wouldn't worry too much if JSLint still comes
> up with some "problems" after he's done; not everything it finds is
> actually a problem.
>
> JSLint has always had its little idiosyncrasies. It doesn't check
> syntax, it checks code style - and in the absence of official style
> guidelines (like they are used in many companies and projects), you'll
> have trouble getting any two developers to agree on a single set of
> rules. JSLint uses the subset of JS that Crockford has defined in his
> book as the "Good Parts", and a number of other rules which he considers
> important.
>
> Unfortunately, not all of these rules make sense for everybody, and many
> of them are hardcoded. The regex lints you posted are a good example:
> JSLint will complain about something like /[ab-]/ ("Unescaped '-'"), but
> there's nothing wrong or ambigous about it. Adding escapes where none
> are necessary is, IMHO, the opposite of good style. There are many other
> examples, like the inability to call functions in a line earlier than
> their declaration, the inevitable warning if functions are created in a
> loop, and more regex hysteria.
>
> To the best of my knowledge, there are no alternatives to JSLint, so we
> have to take the good with the annoying, or do without a lint checker.
> The JQuery team has decided to go with the latter option, which is
> understandable, but it made them miss some of the issues you pointed
> out. Personally, I usually just roll my eyes and change a few characters
> to make JSLint happy, or use a wrapper script which lets me insert
> inline comments to suppress JSLint output.
>
> So, I don't see a problem with JQuery not passing JSLint. If you trust
> the JQuery developers to write the code you're using, you might as well
> trust them to decide which JSLint problems are worth fixing (as long as
> they're aware of them, which they now are).
>
> --
> stefan

Stefan

Yes, indeed it looks like it was a semicolon that really
did _not_ need to be fixed, thus I misspoke.

I appreciate your assessment of jQuery. I do have yet to
see anyone, even the biggest critics, provide any information
about anything really wrong with jQuery -- in the sense that
something does not work (and when things like that come up,
they tend to be minor an tend to be caught by the jQuery
community itself).

The ones with the incredibly negative opinions of jQuery
have not, in my view, made a case. But I will be watching.

Here are the links to changes John Resig made (since one
link was apparently mangled in an earlier post):

http://github.com/jquery/jquery/commit/a18f682012ae8e63f3b43b39375b3c5ce0a561e3
http://github.com/jeresig/sizzle/commit/89dd2b35d51693f46b2043149243920b380ad474
http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c51168e816073