views:

602

answers:

6

Douglas Crockford says:

JavaScript is a sloppy language, but inside it there is an elegant, better language. JSLint helps you to program in that better language and to avoid most of the slop.

Do those programmers who use JSLint on a regular basis have the same opinion?

+6  A: 

I don't use it on any kind of daily basis right now ; it's a bit "too strict" for my taste.

But I've used it for some time in the past, and, considering what it said as "advices", it has probably helped me improve my JS coding style.

Actually, reading some coding-recommandations in JS can be a good thing, even if not using JSLint on a daily basis.
Taking a look at the documentation of JSLint, for instance, can help, giving you ideas of "If some like Douglas Crockford thinks this stuff is bad, maybe it really is" -- just don't forget that you have the right to think by yourself too ;-)
Watching some videos on the YUI Theater is nice too, btw : there are some that are really useful (Including some of Douglas Crockford).

Now, my code is not 100% jslint-correct ; but I certainly have less "bad-coding stuff" than I had before.


And, sometimes, when there is a bug in some piece of code, using JSLint on it can help identify it ;-)

Pascal MARTIN
A better tool for me is the google closure compiler. It allows you to define types through documentation and makes sure functions are called with the right params, and only declared properties are accessed. See http://code.google.com/closure/compiler/docs/js-for-compiler.html
Juan Mendes
A: 

The JavaScript language can be quite beautiful, but it's hard to structure good when making web applications and using it the way it's usually used. JSLint, Crockford and jQuery helps one see the light.

svinto
+4  A: 

My editor actually runs all my .js code through JSLint every time I save. Its warnings and suggestions have pointed out many potential bugs to me before I've even had a chance to encounter them. I love it.

gnarf
Ditto, jslint is definitely a timesaver.
unomi
+1  A: 

JSLint is one way in which we are cleaning up our code in our app. It helps during code review and deciding a third party library is well coded or not. We also use IntelliJ IDEA's inspections which for the most part warns about the same issues. We are also using jQuery which has helped clean up a lot of code.

Artilheiro
+6  A: 

Some say it's too strict. I disagree--you control which offenses it complains about. If it hurts your feelings too much, tone down its warnings.

Nosredna
A: 

If you find JSLint too strict, you'll might prefer MiniME.

Full disclosure, I'm behind this: http://www.toptensoftware.com/minime which does minification, obfuscation and a reasonable set of lint style checks.

cantabilesoftware