So, I happened upon an interesting thread this morning, concerning the recently released jQuery Lint. For those of you who have not dared to look, the comp.lang.javascript newsgroup is truly the proverbial dark alley of JavaScript and DOM development. I can picture it vividly, a dingy dusty cobbled walkway blackened by the thick fog of regressive opinion and unprovoked flame wars, riddled with the unquestioned prerequisite of a newsgroup’s slow death — spam on every corner!

If you have a read through that thread you’ll notice none other than the infamous David Mark. This is the same person that slammed jQuery (oh, and MooTools) for not being able to “do *anything* right” and then, not too long ago, threatened the jQuery project with legal action over some DOM attributes tests.

David had the following to say about jQuery Lint:

Well, sort of. It’s not so much the Johnny-come-lastly advisor plug- in, but the fact that it is just another horrible plug-in for an equally bad pile of JS [he means jQuery]. Anyone who would use jQuery enough to want to write a plug-in is not going to be the best candidate to wtite a browser scripting “lint.” I can’t see it.

He continues:

The idea (which is sound) is to warn developers when they are doing something incorrect (or ill-advised). I haven’t looked at the code for it (and I’m sure I never will). I find I don’t have to do that anymore as the basic rules always apply. :)

David doesn’t stop! He still continues:

[Scott Sauyet]
> It seems to be a tool to help new users learn things like that although this code is legal:

$("selector").css("color", "red").css("margin", 0);
> This would be more efficient:
$("selector").css({color: "red", margin: 0});
[David Mark]
You dump it and replace it with something better (and faster). In this case, something like:
el.style.color = "red"; 
el.style.margin = '0';
That’s smaller, faster, more readable, makes no function calls, creates no new objects and is impervious to upgrades to jQuery (typically poison). And, as we all know, jQuery doesn’t work worth a shit anyway as the “logic” in the script is mostly a diary of confused browser watchers. Get the picture?
> That doesn’t indicate anything wrong with the library any more than > any lint program indicates problems with its target environment.
Of course, you don’t need a lint to see what is wrong with the library. It’s as obviously unsuitable as a dissertation written in crayon.

According to David we should be sparing ourselves the obvious folly of abstraction and spend more time writing “smaller, faster, more readable” JavaScript:

// We say:
$('#elem').css({
    fontWeight: 700,
    width: 200,
    height: 100,
    color: '#000'
});
 
// He says:
var elem = document.getElementById('elem');
elem.style.fontWeight = '700';
elem.style.width = '200px';
elem.style.height = '100px';
elem.style.color = '#000';

David, if you’re reading this, maybe you could offer us a response, detailing why you think jQuery “doesn’t work worth a shit” and also perhaps you could enlighten us why verbose and old-fashioned DOM scripting is miles better than progressive abstractions like the one jQuery offers? And if not too much trouble, I would appreciate if you could spare us your slander and ad hominem.

And when I say “detailing why you think jQuery doesn’t work worth a shit” I don’t mean having a go at petty code inconsistencies and syntax peculiarities.