On Fri, Feb 24, 2012 at 2:42 PM, Christopher Jeffrey <[email protected]>wrote:
> 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. > Yup. IMHO forcing a single var actually *introduces* the hazard of a dropped trailing comma in a compound var deceleration leading to a global. > What else? > > - increment and decrement are not allowed. > Meh. I agree it's pretty silly. > - `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? > I wouldn't put it past him :) > - Of course, the lie that semicolons are necessary to write good > javascript. > If you're actually *using* a linter it would catch the problem spots where semicolons may be intended. So yeah, this. So if you hate on semicolons that's a -1 for *reasons to use jslint*, but a bigger +1 for *reasons to lint*. > - 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. > His stated opinion is that large regexes are bad, by some arbitrary definition of large. But I think we know it when we see it :) > - 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. > > So I almost completely agree about jslint (although you mischaracterized Crock's rationale for banishing switch statements a bit). So to wrap it up: use a linter, just not jslint. -- 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
