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

Re: [jslint] Re: continue

Expand Messages
  • Jean-Charles Meyrignac
    ... You forgot while , which can be replaced by for. ... Sorry, but it doesn t pass JsLint: Problem at line 3 character 2: Missing semicolon. JC
    Message 1 of 28 , Jun 20, 2009
    • 0 Attachment
      On Sat, Jun 20, 2009 at 10:47 PM, Randall Lee Spence wrote:
      >
      > But at what point do we stop? If we
      > warn about breaks, returns, continues and switches, what's to stop us
      > from eliminating for loops and if statements since they can also be
      > misused and abused?

      You forgot 'while', which can be replaced by for.

      > I supposed it would be much easier to write JavaScript if that were
      > the case:
      >
      > var doNothing = function () {
      > //Success!;
      > }
      >
      Sorry, but it doesn't pass JsLint:
      Problem at line 3 character 2: Missing semicolon.

      JC
    • Michael Lorton
      ... 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
      Message 2 of 28 , Jun 20, 2009
      • 0 Attachment
        >> 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 intuitive. But at what point do we stop? If we
        >> warn about breaks, returns, continues and switches, what's to stop us
        >> from eliminating for loops and if statements since they can also be
        >> misused and abused? Eventually we will be left with only empty
        >> function statements, and I am sure someone would have a perfectly
        >> valid complaint about that.
        >>
        >> I supposed it would be much easier to write JavaScript if that were
        >> the case:
        >>
        >> var doNothing = function () {
        >> //Success!;
        >> }
        >>
        >> Randall
        >>
        >Good one, Randall! Dittos!

        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 what to do, and reductionist sarcasm like "well, anything can be misused" doesn't help at all.

        > Jean-Charles Meyrignac <jcmeyrignac@gm...> writes:

        > Sorry, but it doesn't pass JsLint:
        > Problem at line 3 character 2: Missing semicolon.

        Now *that* is a good one.

        M.

        [Non-text portions of this message have been removed]
      • Randall Lee Spence
        ... 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
        Message 3 of 28 , Jun 20, 2009
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, Michael Lorton <mlorton@...> wrote:
          >
          > >> 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 intuitive. But at what point do we stop? If we
          > >> warn about breaks, returns, continues and switches, what's to stop us
          > >> from eliminating for loops and if statements since they can also be
          > >> misused and abused? Eventually we will be left with only empty
          > >> function statements, and I am sure someone would have a perfectly
          > >> valid complaint about that.
          > >>
          > >> I supposed it would be much easier to write JavaScript if that were
          > >> the case:
          > >>
          > >> var doNothing = function () {
          > >> //Success!;
          > >> }
          > >>
          > >> Randall
          > >>
          > >Good one, Randall! Dittos!
          >
          > 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 what to do, and reductionist sarcasm like "well, anything can be misused" doesn't help at all.
          >
          > > Jean-Charles Meyrignac <jcmeyrignac@gm...> writes:
          >
          > > Sorry, but it doesn't pass JsLint:
          > > Problem at line 3 character 2: Missing semicolon.
          >
          > Now *that* is a good one.
          >
          > M.
          >
          > [Non-text portions of this message have been removed]
          >

          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 just don't agree with
          throwing a warning on break or return. Since the original post was
          about continue, and it seems as if enough people have agreed it would
          make a good addition, I suspect we will this as an option in the next
          version of JSLint.

          As I was re-reading the thread I noticed you asked if JSlint warned
          about missing breaks in switch statements, but I didn't see where
          anyone addressed that directly. You may have already found the answer
          on your own, but in case you didn't, and for the benefit of others,
          it does. JSLint expects that the statement before the next case or
          default is either a break, return or throw.

          Randall
        Your message has been successfully submitted and would be delivered to recipients shortly.