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

1357Re: Enhancement Request: Identifier length restriction

Expand Messages
  • pauanyu
    Jul 5, 2010
    • 0 Attachment
      As long as it's an optional switch, I'm fine with that. I can see why that would help some people, especially in a team.

      --- In jslint_com@yahoogroups.com, "abyssoft@..." <abyssoft@...> wrote:
      >
      > That is why I would like it as a switch/option not a requirement.
      >
      > I would write
      >
      > for (var i = 0; i < foo.length; i += 1) {}
      >
      > as
      >
      > var fooIndex;
      > for (fooIndex = foo.length -1 ; fooIndex + 1 ; fooIndex -= 1) {
      > //Loop Content even if only a one liner.
      > }
      >
      > I never declare vars in loops, or in the setup of a loop.
      >
      > --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@> wrote:
      > >
      > >
      > >
      > > What about this (very) common construct:
      > >
      > > for (var i = 0; i < foo.length; i += 1) {}
      > >
      > > I agree that very short identifiers are generally a bad idea, but I also think there are a couple exceptions (like the above).
      > >
      > > --- In jslint_com@yahoogroups.com, "abyssoft@" <abyssoft@> wrote:
      > > >
      > > > Reasoning
      > > >
      > > > Identifiers of only 1 or 2 Characters can lead to errors in thought and poor readability of code. I have a preference for identifiers that consist of 3 or more characters and they are rarely that short.
      > > >
      > > > An alternate enhancement is for support of single and double letter identifiers when listed in /*global*/.
      > > >
      > >
      >
    • Show all 11 messages in this topic