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 <[email protected]> wrote: > On Fri, Feb 24, 2012 at 1:58 PM, Christopher Jeffrey > <[email protected]>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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
