Author of JSLint aint that helpfull at all

Tuesday, 5 August 2008 22:07 by MartinKirk

First when i found JSLint, I was really happy, coz it saved me from a lot of work on Lint'ing Javascript myself...

after few hours i had implemented it nicely into mdk-editor ... which was a piece of cake! - JSLint takes an Array as argument, how easy could it be !!

so onwards, beta testing all day long untill i began wondering about some of the "errors" that JSLint supposedly finds in my scripts .. Undecided

var a = new Array(5)

Yields an error, because dear Douglas doesn't have confidence enough in us to actually know what "new Array(5)" does... I admit that it may be frustrating to do this: var a = new Array(2,2) - and expect a 2 dimmensional Array, which is ofcause not the case. Even further i support the notion that var a = new Array(2) doesn't return a 1 dimmensional Array with values "1"... however spending 2 hours on Javascript Arrays and one might be confident enough to use it accurately.

On Jslint.com youll find the greeting comment:  Please let me know if JSLint is useful for you. Is it too strict? Is there a check or a report that could speed up your debugging? douglas@crockford.com

so i wrote him nicely, that the "new Array()" error, should become a warning, rather then an Error... coz its really not an Error, is it ??

he dismissed it..  quote:

new Array does not do what you think it does. Part of JSLint's mission
is to help you discover where your reasonable expectations about
JavaScript are incorrect. It is much harder to write correct programs
if you do not understand what the language actually does. Use [].

... Mkay

I've now solved the new Array issues (as seen in my previous post about Arrays).

Another "Error" which bothered me, what the chronology of code, ex: function definition not comming before use... Seems completely irrelevant in a language that doesn't care about it anyway... "warning" maybe?

But then i stopped... Apparently JSLint failes on the occationally used multine comment trick:

// switch between functionalities by removing a '*'
/**/
    UseThisCodeNow();
/*/
    UseAnotherCode();
/**/

So i wrote the dear Douglas again... claiming that such a functionality is part of the language, due to the parser's way of interpreting the opening and closing "tags"

he dismissed the flaw in JSLint, quote:

That is a terrible practice. It is easy enough to program computers to
do useful things. You shouldn't need to rely on silly tricks.

omg... he is annoying !... a BOFH' like programmer Yell

Tags:   , , ,
Categories:   Javascript | MDK-Editor | Mixed
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed
Comments are closed