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

Re: [jslint] Re: JSLint errors wiki?

Expand Messages
  • Jordan Harband
    Comments serve a purpose, trailing whitespace does not. If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even
    Message 1 of 18 , Sep 26, 2011
    • 0 Attachment
      Comments serve a purpose, trailing whitespace does not.

      If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.

      On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:

      > The same could be said about comments.
      >
      > Has anyone come across an error caused by spaces on a blank line in JavaScript?
      >
      > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
      > >
      > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
      >
      >



      [Non-text portions of this message have been removed]
    • tom.haggie@sap.com
      There s an option to say I don t care about whitespace it should honour it. In most production systems the js code is processed by minification before it gets
      Message 2 of 18 , Sep 26, 2011
      • 0 Attachment
        There's an option to say I don't care about whitespace it should honour it.

        In most production systems the js code is processed by minification before it gets deployed, these checks are just more work for no value for people who work in such an environment.

        -*TOM*-

        --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
        >
        > Comments serve a purpose, trailing whitespace does not.
        >
        > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.
        >
        > On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:
        >
        > > The same could be said about comments.
        > >
        > > Has anyone come across an error caused by spaces on a blank line in JavaScript?
        > >
        > > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
        > > >
        > > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
        > >
        > >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
      • Robert Ferney
        If I am having to triage ( because I have more problems to fix than I have time), broken code has to take priority compared to something that does not break
        Message 3 of 18 , Sep 26, 2011
        • 0 Attachment
          If I am having to triage ( because I have more problems to fix than I
          have time), broken code has to take priority compared to something
          that does not break code.

          Objectively, something that does not break, has to be less important
          than something that does.. Just as someone that is bleeding out will
          get treated before someone that has simply broken their nose.. Not
          that it is not important to have both injuries treated.. but a broken
          nose is usually not life threatening..

          If there is a problem with my script that will cause it to not work,
          then I want to fix that right away..

          If it's something that will help with readability, for the developer
          that has to tackle the code next, ( even if that's me a week from now
          ) I still want to fix that, but that's secondary to having it work in
          the first place.

          If it's just a byte or two extra for file transfer reasons, I may not
          care much, especially if the minimizer will take care of it anyway.

          I still want to know *why* it's a problem.. So I can figure out if
          it's a case where my code is bleeding out on the table, or if it's
          just spilled water over it'self..

          - Robert Ferney


          On Mon, Sep 26, 2011 at 10:32 AM, Jordan Harband <ljharb@...> wrote:
          > Comments serve a purpose, trailing whitespace does not.
          >
          > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.
          >
          > On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:
          >
          >> The same could be said about comments.
          >>
          >> Has anyone come across an error caused by spaces on a blank line in JavaScript?
          >>
          >> --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
          >> >
          >> > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
          >>
          >>
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
        • Erik Eckhardt
          This flamboyantly defies logic. Extra whitespace may be useless and unnecessary but also is completely harmless. If you were a boss would you seriously take
          Message 4 of 18 , Sep 26, 2011
          • 0 Attachment
            This flamboyantly defies logic.

            Extra whitespace may be useless and unnecessary but also is completely
            harmless. If you were a boss would you seriously take your staff to task
            equally harshly for carelessly including extra trailing whitespace in the
            code as you would for irresponsibly breaking the build?

            The option to ignore whitespace should (drum roll please ... wait for it
            .... wait for it ... ) *ignore whitespace*. TADAAAHHHH!!!

            And since when do we make our programming decisions based on repulsiveness
            rather than efficiency? Feeling enough angst about whitepsace to waste a lot
            of time on it is not healthy.

            Erik

            On Mon, Sep 26, 2011 at 9:32 AM, Jordan Harband <ljharb@...> wrote:

            > trailing whitespace ... is still useless and unnecessary, and that should
            > be regarded equally as repulsive as broken code.
            >
            >


            [Non-text portions of this message have been removed]
          • paulcrowder1979
            ... This statement is ridiculous. I use a rather popular editor called Visual Studio (some of you may have heard of it) that preserves indentation on blank
            Message 5 of 18 , Sep 28, 2011
            • 0 Attachment
              --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
              >
              > Comments serve a purpose, trailing whitespace does not.
              >
              > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.

              This statement is ridiculous. I use a rather popular editor called Visual Studio (some of you may have heard of it) that preserves indentation on blank lines so that if you place the cursor there, anything you type will already be indented properly. As far as I know there's no way to change this behavior. Because my code is always minified before being put into production, this extra whitespace has absolutely no effect on the end product. I'm really starting to sour on JSLint because of the recent nonsense that's been added. It's a real shame because I've championed it for years.
            • sandyhead25
              Output generated by JavaScript rarely exists in a vacuum. There are other areas where white space characters have specific meaning. Even in JavaScript white
              Message 6 of 18 , Sep 28, 2011
              • 0 Attachment
                Output generated by JavaScript rarely exists in a vacuum. There are other areas where white space characters have specific meaning. Even in JavaScript white space characters, at certain times, have syntactical value. In XML/HTML white space has meaning. It either alters the length of an existing text node or creates an entirely new text node when not adjacent to a prior existing text node. Improper use of white space will break TCL. Web servers also do funny things with white space characters during a post/get request and sometimes properly encoding the white space characters in URI can still throw errors.

                Always yield on the side of caution. Just because you are not aware that extra white space characters ever do anything does not mean you are void of harm.

                --- In jslint_com@yahoogroups.com, "urangatang@..." <urangatang@...> wrote:
                >
                > The same could be said about comments.
                >
                > Has anyone come across an error caused by spaces on a blank line in JavaScript?
                >
                > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
                > >
                > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                >
              • Erik Eckhardt
                Based on past experiences I am one of the most conservative developers there are. My desire to do things right and cover all the eventualities are often
                Message 7 of 18 , Sep 28, 2011
                • 0 Attachment
                  Based on past experiences I am one of the most conservative developers there
                  are. My desire to "do things right" and "cover all the eventualities" are
                  often scoffed at--until systems start breaking and the "almost never
                  happens" exception takes everything to a screeching halt.

                  However, I have to say that not all risks are equal, and in the real world
                  efficiency is right up there in value next to correctness or
                  comprehensiveness. It doesn't matter if you're doing it right if it never
                  gets built at all. And, spending a relatively high amount of effort on an
                  extremely low risk item is extremely inefficient. Placing caution where it
                  is not due actually has a formal word: paranoia.

                  Sanity just doesn't care that in different contexts, white space can screw
                  things up. In the context of most code, be it javascript. C++, C#, VBScript
                  or whatever, extra whitespace is harmless.
                  If we were to use the same logic in real life, based on the knowledge that
                  SOME buttons launch nuclear missiles, we should NEVER ever push any button,
                  for fear of it launching a missile that kills thousands or millions of
                  people. No. We use our domain knowledge to shape our understanding of the
                  risk and concomitantly structure our behavior.

                  In theory there is no difference between theory in practice. In practice,
                  there is.

                  On Wed, Sep 28, 2011 at 2:42 PM, sandyhead25 <austin.cheney@...>wrote:

                  > **
                  >
                  >
                  > Output generated by JavaScript rarely exists in a vacuum. There are other
                  > areas where white space characters have specific meaning. Even in JavaScript
                  > white space characters, at certain times, have syntactical value. In
                  > XML/HTML white space has meaning. It either alters the length of an existing
                  > text node or creates an entirely new text node when not adjacent to a prior
                  > existing text node. Improper use of white space will break TCL. Web servers
                  > also do funny things with white space characters during a post/get request
                  > and sometimes properly encoding the white space characters in URI can still
                  > throw errors.
                  >
                  > Always yield on the side of caution. Just because you are not aware that
                  > extra white space characters ever do anything does not mean you are void of
                  > harm.
                  >
                  >
                  > --- In jslint_com@yahoogroups.com, "urangatang@..." <urangatang@...>
                  > wrote:
                  > >
                  > > The same could be said about comments.
                  > >
                  > > Has anyone come across an error caused by spaces on a blank line in
                  > JavaScript?
                  > >
                  > > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
                  > > >
                  > > > How are extra bytes in your file that serve no purpose and can easily
                  > be removed by most editors, pre-commit hooks, or a command line tool NOT a
                  > problem?
                  > >
                  >
                  >
                  >


                  [Non-text portions of this message have been removed]
                • Luke Page
                  Visual studio often pretends there is whitespace to make editing easier and then inserts the whitespace when you type the first character. However like most
                  Message 8 of 18 , Sep 28, 2011
                  • 0 Attachment
                    Visual studio often pretends there is whitespace to make editing easier and
                    then inserts the whitespace when you type the first character.

                    However like most other editors it does appear sometimes. I'm sure that
                    there is either an option to trim at save or an extension that does it...
                    On 28 Sep 2011 22:33, "paulcrowder1979" <paul@...> wrote:
                    > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                    >>
                    >> Comments serve a purpose, trailing whitespace does not.
                    >>
                    >> If you avoid ASI by properly using semicolons, I doubt trailing
                    whitespace will break your code, even with minification. However, it is
                    still useless and unnecessary, and that should be regarded equally as
                    repulsive as broken code.
                    >
                    > This statement is ridiculous. I use a rather popular editor called Visual
                    Studio (some of you may have heard of it) that preserves indentation on
                    blank lines so that if you place the cursor there, anything you type will
                    already be indented properly. As far as I know there's no way to change this
                    behavior. Because my code is always minified before being put into
                    production, this extra whitespace has absolutely no effect on the end
                    product. I'm really starting to sour on JSLint because of the recent
                    nonsense that's been added. It's a real shame because I've championed it for
                    years.
                    >


                    [Non-text portions of this message have been removed]
                  • paulcrowder1979
                    ... At my company we have hundreds of thousands of lines of JavaScript, all of which get validated at some point using JSLint. There s no way I m going to fix
                    Message 9 of 18 , Sep 30, 2011
                    • 0 Attachment
                      --- In jslint_com@yahoogroups.com, Luke Page <luke.a.page@...> wrote:
                      >
                      > Visual studio often pretends there is whitespace to make editing easier and
                      > then inserts the whitespace when you type the first character.
                      >
                      > However like most other editors it does appear sometimes. I'm sure that
                      > there is either an option to trim at save or an extension that does it...

                      At my company we have hundreds of thousands of lines of JavaScript, all of which get validated at some point using JSLint. There's no way I'm going to fix up all those files as well as modify the settings and/or extensions on 100+ developer machines just so we can enforce a rule that has absolutely zero effect on the end result.
                    Your message has been successfully submitted and would be delivered to recipients shortly.