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

[jslint] Re: JSLint errors wiki?

Expand Messages
  • 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 1 of 18 , Sep 28 2:42 PM
    • 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 2 of 18 , Sep 28 4:13 PM
      • 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 3 of 18 , Sep 28 11:34 PM
        • 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 4 of 18 , Sep 30 12:12 PM
          • 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.