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

944Re: [jslint] Maximum line lengths

Expand Messages
  • Paul Novitski
    Oct 1, 2009
      At 10/1/2009 03:01 PM, 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.

      I respectfully disagree. There is no such thing as an ideal line
      length for the masses. The individual user determines the browser
      window width, the text display size and font, and, in most text
      editors I've used, the line wrap toggle. Also, line length warning
      messages would likely be merely irritating for the users of
      visually-assistive user agents such as audio and Braille readers.

      If such a feature were added to jslint, I would hope that its default
      would be off and that each user would set that "certain length"
      rather than it being determined by Douglas or anyone else.



      Paul Novitski
      Juniper Webcraft Ltd.
    • Show all 9 messages in this topic