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

2556[jslint] Re: Formatting question

Expand Messages
  • abyssoft@ymail.com
    Aug 4, 2011
    • 0 Attachment
      I use a formatting that is indeed supported by JSLint and is highly readable to me

      var
      ....varname1,
      ....varname2 = "suchandsuch",
      ....varname3 = 1234;

      that way if I see a var I know that until I see the ; I am still with in my declaration block.


      --- In jslint_com@yahoogroups.com, Doc Emmett Splendid <emmett.thesane@...> wrote:
      >
      > I've struggled with how to organize unintialised variables in one full var statement as well (largely because I only recently became convinced through experience that the "one var per function" is The Right Thing To Do). I haven't followed this format in the past, but I will do so henceforth for the very reason you say.
      >
      > Emmett
      >
      >
      > ________________________________
      > From: Robert Ferney <capnregex@...>
      > To: jslint_com@yahoogroups.com
      > Sent: Thursday, 4 August 2011, 13:33
      > Subject: Re: [jslint] Re: Formatting question
      >
      >
      >  
      > Just as a personal impression.
      > I do find
      >
      > var i, j,
      > elementInWebPage = YAHOO.util.Dom.get('someElementID');
      >
      > more readable than
      >
      > var elementInWebPage = YAHOO.util.Dom.get('someElementID'),
      > i, j;
      >
      > having the un-initialize variables first, makes if obvious that they are
      > being declared as variables. while in the second form, the i, j; look a bit
      > orphaned.
      >
      > - Robert Ferney
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Show all 16 messages in this topic