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

Re: Maximum line lengths

Expand Messages
  • pauanyu
    ... Excellent idea! Some computer systems (mostly text-only) are incapable of displaying lines that are longer than 80 characters. Rather than wrapping, they
    Message 1 of 9 , Oct 2, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Chris" <Nielsen.Chris@...> wrote:
      >
      > Code can become difficult to read if it goes on for too long without a line break. This most obviously becomes a problem as soon as it becomes necessary to scroll horizontally, but I find that readability actually becomes affected well before that.
      >
      > I find that code is cleaner and more understandable if care is taken that no lines exceed 80 - 100 characters in length.
      >
      > I suggest that JSLint include an option that would produce a warning message when a line exceeds a certain length (including comments). The specific length in question would probably need to be a user preference, similar to how the indentation setting works. I am sure many people have differing opinions on how long is "too long." I personally prefer 80 characters.
      >

      Excellent idea! Some computer systems (mostly text-only) are incapable of displaying lines that are longer than 80 characters. Rather than wrapping, they will truncate anything past the 80th character.

      That is at least one good reason to include this option. I am also in favor of making it user-selectable, as some would have different preferences.
    • Michael Lorton
      People who use systems limited to 80 characters don t need JSLint because they are living in 1987 and Javascript hasn t been invented yet. The reason to limit
      Message 2 of 9 , Oct 2, 2009
      • 0 Attachment
        People who use systems limited to 80 characters don't need JSLint because they are living in 1987 and Javascript hasn't been invented yet.

        The reason to limit line length is not for the display -- it's for readability. Humans don't process big chunks of text that well. Limit lines to 80 characters, maybe 100 at the most, and limit functions to 20 lines, 40 at the most, so that other people can figure out your code. (Whether JSLint should be the thing that enforces that limit is another question.)

        M.




        ________________________________
        From: pauanyu <pcxunlimited@...>
        To: jslint_com@yahoogroups.com
        Sent: Friday, October 2, 2009 5:24:59 AM
        Subject: [jslint] Re: Maximum line lengths



        --- In jslint_com@yahoogroups.com, "Chris" <Nielsen.Chris@...> wrote:
        >
        > Code can become difficult to read if it goes on for too long without a line break. This most obviously becomes a problem as soon as it becomes necessary to scroll horizontally, but I find that readability actually becomes affected well before that.
        >
        > I find that code is cleaner and more understandable if care is taken that no lines exceed 80 - 100 characters in length.
        >
        > I suggest that JSLint include an option that would produce a warning message when a line exceeds a certain length (including comments). The specific length in question would probably need to be a user preference, similar to how the indentation setting works. I am sure many people have differing opinions on how long is "too long." I personally prefer 80 characters.
        >

        Excellent idea! Some computer systems (mostly text-only) are incapable of displaying lines that are longer than 80 characters. Rather than wrapping, they will truncate anything past the 80th character.

        That is at least one good reason to include this option. I am also in favor of making it user-selectable, as some would have different preferences.



        ------------------------------------

        Yahoo! Groups Links



        [Non-text portions of this message have been removed]
      • Dominic Mitchell
        ... I find most printers only really do 80 columns well. If you wrap, it gets unreadable very quickly. ... I ll add a +1 for an optional warning for this.
        Message 3 of 9 , Oct 2, 2009
        • 0 Attachment
          On Fri, Oct 2, 2009 at 7:15 PM, Michael Lorton <mlorton@...> wrote:

          > People who use systems limited to 80 characters don't need JSLint because
          > they are living in 1987 and Javascript hasn't been invented yet.
          >

          I find most printers only really do 80 columns well. If you wrap, it gets
          unreadable very quickly.


          > The reason to limit line length is not for the display -- it's for
          > readability. Humans don't process big chunks of text that well. Limit
          > lines to 80 characters, maybe 100 at the most, and limit functions to 20
          > lines, 40 at the most, so that other people can figure out your code.
          > (Whether JSLint should be the thing that enforces that limit is another
          > question.)
          >

          I'll add a +1 for an optional warning for this. Whilst I don't think it's
          something to enforce on everybody, it can be a useful tool as part of a
          local standard.

          -Dom


          [Non-text portions of this message have been removed]
        • Michael Newton
          From: Michael Lorton ... You ve clearly never edited outside the comfort of your GUI! This is a problem for me when I SSH into a remote
          Message 4 of 9 , Oct 2, 2009
          • 0 Attachment
            From: Michael Lorton <mlorton@...>
            >People who use systems limited to 80 characters don't need JSLint because they are living in 1987 and Javascript hasn't been invented yet.

            You've clearly never edited outside the comfort of your GUI! This is a problem for me when I SSH into a remote machine and have to use nano to look at code. (No, I'm not cool enough to use vi or emacs.) This seems like a useful option for some, obviously it would be disabled by default just like the strict whitespace option.


            __________________________________________________________________
            Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
          • Stefan Weiss
            ... Just for the record - neither vi, emacs, nano, or Unix terminals put any restrictions on line length. If you use PuTTY (or some other terminal emulator) to
            Message 5 of 9 , Oct 3, 2009
            • 0 Attachment
              On 03/10/09 01:09, Michael Newton wrote:
              > From: Michael Lorton <mlorton@...>
              >> People who use systems limited to 80 characters don't need JSLint
              >> because they are living in 1987 and Javascript hasn't been invented yet.
              >
              > You've clearly never edited outside the comfort of your GUI! This is a
              > problem for me when I SSH into a remote machine and have to use nano to
              > look at code. (No, I'm not cool enough to use vi or emacs.) This seems
              > like a useful option for some, obviously it would be disabled by default
              > just like the strict whitespace option.

              Just for the record - neither vi, emacs, nano, or Unix terminals put any
              restrictions on line length. If you use PuTTY (or some other terminal
              emulator) to SSH to the server, you can just resize your window or tell
              the terminal emulator how wide you want your lines. The old "hard" 80
              char limit is really an anachronism, GUI or not.

              That said, source lines can become too long to read comfortably, and
              "maxlen" it is a very useful new option in JSLint. I'm definitely going
              to use it.


              cheers,
              stefan


              --
              LOAD"Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!",8,1
              RUN!
            Your message has been successfully submitted and would be delivered to recipients shortly.