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

Curly Braces on own line is now valid. Is this change permanent?

Expand Messages
  • walfisch1
    Curly Braces on own line is now valid. Is this change permanent? var x; if (x !== 1) { x = 1; }
    Message 1 of 3 , Feb 3, 2011
    • 0 Attachment
      Curly Braces on own line is now valid. Is this change permanent?

      var x;
      if (x !== 1)
      {
      x = 1;
      }
    • Douglas Crockford
      ... I don t know. It is still a bad practice in this language. If you are smart, you will transition to a K&R style.
      Message 2 of 3 , Feb 3, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "walfisch1" <christian.wirkus@...> wrote:
        >
        > Curly Braces on own line is now valid. Is this change permanent?
        >
        > var x;
        > if (x !== 1)
        > {
        > x = 1;
        > }

        I don't know. It is still a bad practice in this language.
        If you are smart, you will transition to a K&R style.
      • urangatang@att.net
        ... I m a little confused because I think K&R style should have functions braced distinctly from statements, but JSLint does not allow this with the strict
        Message 3 of 3 , Feb 3, 2011
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          > If you are smart, you will transition to a K&R style.

          I'm a little confused because I think K&R style should have functions braced distinctly from statements, but JSLint does not allow this with the strict whitespace option turned on.
        Your message has been successfully submitted and would be delivered to recipients shortly.