[Javascript] Literal array declarations

Noah Sussman blinkdog at gmail.com
Thu Oct 29 18:36:25 CDT 2009


On Thu, Oct 29, 2009 at 5:12 PM, Paul Novitski <paul at juniperwebcraft.com> wrote:
> If omitting the "new" in a "new Array()" construction is bad form,
> why not check for that omission specifically instead of forbidding
> use of the syntax altogether? I don't mean this as a rhetorical
> question; I'd really like to understand Douglas' perspective.

You might be interested in this thread from the JSLint dev list.

http://tech.groups.yahoo.com/group/jslint_com/message/592

> There are many language features in JavaScript that would cause
> problems of one sort or another if entered incorrectly. We don't
> avoid them, we learn to code correctly. Jslint and validators in
> general can be a wonderful help by proofreading our work in detail.
> It's when jslint objects to the use of perfectly valid syntax & style
> not because the code is incorrect or causing a problem but because
> its misuse might cause a problem in some other script someday

Just my .02 but, for better or worse, I think you have summed up the
intent of JSLint rather well in that last sentence.

And I think JSLint is largely targeted at developers in "the
enterprise," where ad hoc adoption of untested third-party JavaScript,
is all too often a common practice.




-- 
Noah Sussman
nerdabout.com
noah at one more bug dot com
Writing is the beating heart of online user experience -- @Zeldman
Software is fiction, it is imagination. -- Richard Gabriel



More information about the Javascript mailing list