at yui conf this year, Cockfod explained why he did JSLint and how. These
rules emanes directly from most recuring errors he founds on newsgroups.

As these may seems eally harsh, JSLint is a good tool to find unsuspected
bug or strange bug.

As I'm often thinking:  rules are made for those who cannot think and go
beyond. Before, saying that a rule is bullshit, try to understand why it's
there and learn from it.
Le 24 févr. 2012 20:42, "Christopher Jeffrey" <chjjeff...@gmail.com> a
écrit :

> Yeah the way jslint treats vars is insane. As long as you're aware of
> function scope, the fact that javascript hoists vars, and that a
> simple `var a;` statement doesn't initialize `a`, there's no problem.
>
> What else?
>
> - increment and decrement are not allowed.
>
> - `if (a) statement;` is evil? ...give me a break. Why hasn't
> crockford written a linter for C, to tell the millions of C coders
> that they've been wrong for decades?
>
> - Of course, the lie that semicolons are necessary to write good
> javascript.
>
> - Regexes are bad? (Part of "crockford philosophy"). Sorry, given the
> performance I can get out of v8 with them, I can't *not* use them in
> many situations.
>
> - no continue statements? I'm looking at the entire list of options
> and I disagree with every one of these features. I'm sure crockford
> has been constantly criticized by sane people for his linter's
> ridiculous behavior. I'm guessing he just added these options to shut
> them up.
>
> I also just noticed this little gem I couldn't believe. I had to see
> it with my own eyes:
>
> var a;
> a = 1 << 1;
>
> yields:
>
> Problem at line 3 character 7: Unexpected '<<'.
>
> Apparently bitwise operations are pure evil.
>
> On Feb 24, 1:12 pm, Matt <hel...@gmail.com> wrote:
> > On Fri, Feb 24, 2012 at 1:58 PM, Christopher Jeffrey
> > <chjjeff...@gmail.com>wrote:
> >
> > > I don't want to say all linting is useless. JS(L/H)int sure as hell is
> > > though.
> >
> > I hate the meme, but: ^ THIS.
> >
> > > JSLint is completely based on subjective experience over fact. What
> > > was crockford's explanation of why he doesn't allow case fall-through?
> >
> > > "One time my case fell-through *unintentionally* and bad things
> > > happened, so now I think falling through *intentionally* is bad.*
> >
> > > Did you spot the nonsequitur?
> >
> > Yeah it's a complete nonsense stance. Another one for me: Crockford
> > enforces that doing:
> >
> >     for (var i=0,l=foo.length; i<l; i++) {
> >         ...
> >     }
> >
> > is a bad thing (the "var" declaration) and not allowed (and not
> > configurable/switchable). I totally understand that the variables aren't
> > technically scoped there by the virtual machine running the javascript, I
> > don't care, because Javascript is written for humans, and that's where it
> > is scoped for me, the programmer. Let me do it anyway!
> >
> > Matt.
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to