Categories
Uncategorized

JSLint Backlash

Typically enough, two days after I start on something, there’s a backlash. Dean Edwards (whom I respect highly) points out that JSLint is not a silver bullet in JSLint Considered Harmful.

(aside: everybody please read ‘Considered Harmful’ Essays Considered Harmful. Thank you)

The post he links to brings up a number of valid points about where valid uses of JavaScript can be flagged up by JSLint. This is perfectly reasonable. For example, you rarely want to use eval() in JavaScript, but when you need it, it’s the only way to do what you want. In that case, JSLint provides a flag to disable the warning.

But the real point is that you can’t just blindly follow results from a tool for what are ultimately stylistic issues like these. You have to use your knowledge as a programmer to interpret the output and agree / disagree with each point as appropriate. The purpose of JSLint is to flag areas that might be of concern, or perhaps be liable to bugs. It’s not saying “this is a bug, absolutely, for sure”.

One thing which might be useful (although I have no idea how easy it would be to implement) would be to be able to specify hints in the same manner that you could for C lint. There is already one example (declaring external definitions), but there could be more.

Whilst I am sure that it has it’s flaws, I’m extremely glad to see tools like JSLint being made available. Analysis tools like these help to move JavaScript from being “toy for websites” to “useful programming language”.

Now all I want is a JavaScript equivalent of perltidy

Categories
Uncategorized

Blog Buttons

I’ve seen links to “add this to del.icio.us” for some time now. I never use them. It’s a complete waste of time, my links toolbar is perfectly adequate.

A couple of months ago, I saw that people started adding more buttons to their blog posts. “Add to del.icio.us.” “Digg This!” “Reddit?”

Again, all a complete waste of time, and precious page space.

Unfortunately, today I have just witnessed this vile insanity:

Blog Buttons

I mean, really, what the hell are all those little things? And more to the point, who cares?

Categories
Uncategorized

JavaScript::Lint 0.02

I’ve just put together a new version of JavaScript::Lint. The main new thing is that you can now specify options to control how the lint works. You probably want to enable the undef option, for instance.

I also fixed a problem where I was covering up errors when the lint couldn’t do anything more (e.g. nested comments). After my mailing Douglas Crockford about it, he kindly pointed out that this was mentioned in the comments. I’d entirely missed it. Ah well. Anyway, it now returns a “cannot proceed” message.

Update: after spotting something rather stupid, I’ve now uploaded JavaScript::Lint 0.03 instead.