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

Re: [jslint] Re: Maximum line lengths

Expand Messages
  • 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 1 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 2 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 3 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.