... If indentation becomes that big a problem that you can no longer read your code you can either make design decisions more conservatively, reduce the size...
671
Michael Lorton
mlorton
Jun 20, 2009 2:51 pm
... The problem with excessive nesting is not (or not primarily) that it is difficult to read. The problem is that it is difficult to understand. In formal...
672
crlender
Jun 20, 2009 3:24 pm
... There's a difference for you? ... If you start reading a function at a |break| statement in the middle, yeah, you will have to backtrack to the top to know...
673
Randall Lee Spence
analogueweb
Jun 20, 2009 3:56 pm
... to suggest that JSLint optionally generate warnings for "continue", "break", and "return", and that option be turning by default, at least for the first...
674
mbrrtt
Jun 20, 2009 6:06 pm
Another small bug: JSLint doesn't like it if you break the /*jslint ... */ line after a colon. (It does accept line breaks after a comma.) /*jslint bitwise:...
675
Michael Lorton
mlorton
Jun 20, 2009 7:45 pm
Since everyone asked, here is my personal Scale of Evil Control Structures, from most to least: goto -- so evil, you probably shouldn't even use a language...
676
sandyhead25
Jun 20, 2009 7:59 pm
... Break is not evil. It forces early return from a loop, which results in a value for the iterator that is neither the start or end value of the loop. That...
677
Randall Lee Spence
analogueweb
Jun 20, 2009 8:47 pm
... I am sure that if this topic is debated long enough, almost every statement or method will have someone calling it evil or declaring its use as counter...
678
jeddahbill
Jun 20, 2009 9:38 pm
... Good one, Randall! Dittos!...
679
Jean-Charles Meyrignac
jcmeyrignac
Jun 20, 2009 10:02 pm
... You forgot 'while39;, which can be replaced by for. ... Sorry, but it doesn't pass JsLint: Problem at line 3 character 2: Missing semicolon. JC...
680
Michael Lorton
mlorton
Jun 21, 2009 1:07 am
... How is that a good one? Yes, nothing on this earth is perfectly good and few things are perfectly evil, but we still have the daily task of figuring out...
681
Randall Lee Spence
analogueweb
Jun 21, 2009 2:03 am
... I agree Michael, that was a good one! Reductionist sarcasm aside, I'd like to state again that I do agree with JSLint throwing a warning on continue, I...
682
jslint_com@yahoogroup...
Jun 21, 2009 2:07 am
Enter your vote today! A new poll has been created for the jslint_com group: Should JSLint complain about continue statements? o Yes o No To vote, please...
683
pauanyu
Jun 21, 2009 6:40 am
... I gave some more thought to this. Right now, if you want to use the global "name" and local "name", JSLint says you *must* put either "var name;" or...
684
pauanyu
Jun 21, 2009 6:52 am
I think JSLint should complain about "continue", but have an option to turn it off, if you want. I don't see that listed as an option in the poll, however....
685
Michael Lorton
mlorton
Jun 21, 2009 7:17 am
Pretty much everything in JSLint has an option to turn it off. M. ________________________________ From: pauanyu <pcxunlimited@...> To:...
686
pauanyu
Jun 21, 2009 8:11 am
... Yes, but not everything.. you can't turn off this: if (condition) doSomething; while (condition) doSomething; There are others as well, I'm sure, such as...
687
Douglas Crockford
douglascrock...
Jun 21, 2009 1:06 pm
... I don't think continue is important enough to get an option. So the question is should it be treated as with. I think continue is unnecessary. There are a...
688
Michael Lorton
mlorton
Jun 21, 2009 4:40 pm
Huh. Didn't know about that one. Maybe we should have JSUnLint, goes through and corrects any correctable errors; e.g., put the missing braces around the...
689
pauanyu
Jun 22, 2009 6:20 am
... I believe there are already several JavaScript "beautifiers", designed to unminify code. I'm sure they could support something like this....
690
Jakob Kruse
thekrucible
Jun 22, 2009 6:31 am
That would kind of defeat the whole purpose of JSLint I think. When JSLint complains about something in your code it’s because there’s a good chance it...
691
sandyhead25
Jun 22, 2009 11:11 am
... There is a reason why the YUI compressor is in Java and is not available in JavaScript. It adds curly braces to conditions which do not have them and it...
692
pauanyu
Jun 22, 2009 11:52 am
... I believe he was referring to a new program, separate from JSLint, and not JSLint itself. Note how he said "JSUnLint" as opposed to "JSLint"....
693
mbrrtt
Jun 22, 2009 3:18 pm
This may be slightly offtopic, but since the question relates to proper style and there are many JS experts in this group, I'm posing the question here. Can...
694
mbrrtt
Jun 22, 2009 3:21 pm
And does anyone know how to write code and (especially) how to get proper indentation in posts to this group?...
695
pauanyu
Jun 23, 2009 8:08 am
... As to your first question... In my experience, yes. It's treated as if you had used two separate vars, so the order is maintained. No clue if it'll stay...
696
christian.wirkus
christian.wi...
Jun 23, 2009 12:47 pm
var x = 1, y = 2 * x, z = x + y; x === 1; y === 2; z === 3; You can rely on the evaluation to be from left to right or top to bottom. How to indent? I don't...
697
Noah Peters
boyopeg
Jun 29, 2009 5:00 pm
With the newest version of JSLint I am having a frequent error on this code block: if (typeof console==="undefined") { console = { log: function() {}, dir:...
698
Douglas Crockford
douglascrock...
Jun 29, 2009 6:04 pm
... Either turn off the Assume a Browser option, or add this comment: /*global console: true*/...