in reply to Re^8: Quote and Quote-like Operators (heredocs break)
in thread Quote and Quote-like Operators

You'll probably deride the notion, but I've long since had my editor configured to 'strip trailing whitespace on save' when editing source files for every programming language I use.

I was seriously frustrated by the effects of the presence of a space after the \ on a continuation line. Once bitten, twice shy.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re^9: Quote and Quote-like Operators (heredocs break)

Replies are listed 'Best First'.
Re^10: Quote and Quote-like Operators (trailing space)
by tye (Sage) on Dec 16, 2011 at 20:33 UTC

    Our code review tool shows trailing whitespace in red. I should make sure our git is configured to complain about commits that include new/changed lines containing trailing whitespace. My editor is configured to make trailing whitespace visible. But, no, I don't have it automatically strip such. But I do often strip all trailing whitespace.

    One reason to not unconditionally strip whitespace has to do with merge conflicts, so I will usually commit whitespace changes in a separate commit from any other changes. Once bitten by having to spend hours on a merge conflict due to extensive whitespace changes interfering with automated merge resolution, twice shy. :)

    But if you don't have to worry about that case, I have a hard time coming up with a compelling argument against automated removal of trailing whitespace.

    I've long advocated not using chomp but instead doing s/\s+$// because trailing whitespace should never matter (it also helps avoid problems with unexpected \r characters, which also shouldn't matter).

    When composing my prior node, I recalled being worried that the C preprocessor might not properly handle an at-line-end \ if it is followed by a space. I did a quick test and the first cpp I ran across didn't have that bug. But I'm not surprised if other (especially earlier) versions did.

    - tye        

      But I'm not surprised if other (especially earlier) versions did.

      Yes. It was a long time ago. I can't even remember much of the detail, just the overwhelming frustration of a long night wasted chasing such a simple bug.

      It was probably an early IBM compiler or possibly Borland.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?