Loading ...
Sorry, an error occurred while loading the content.

1619Re: [jslint] Re: Filtered for...in

Expand Messages
  • Cheney, Edward A SSG RES USAR USARC
    Nov 19, 2010
    • 0 Attachment
      Erik,

      > In my opinion this is little different than this greatly-upvoted Stack
      > Overflow

      I deleted my Stack Overflow account in late spring. Popularity is not a
      correlation to accuracy.

      > The top 533 votes on the 3-most-upvoted answers all weigh in that they
      > think the "one return per procedure" rule is, well, stupid.

      There is nothing wrong with multiple exit points from a container of
      logic. If you have all that you need then destroy the current loop and
      exit the current container as early as possible. This is the only way I
      could make my markup beautification logic perform in an acceptable time
      frame.

      > I think this is one of those cases: I don't want to exit the loop, I
      > don't want a huge if block polluting my function, I just want to
      > quickly go to the next loop if the circumstances for this invocation
      > are wrong.

      The point of the continue statement is to break the current index of a
      loop provided a condition without breaking from the loop. Since you are
      not wanting to exist the loop it would make more sense to plan around
      that condition where you do exit prematurely thereby negating the use of
      continue.

      Austin Cheney, CISSP
      http://prettydiff.com/
    • Show all 19 messages in this topic