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

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        

Replies are listed 'Best First'.
Re^11: Quote and Quote-like Operators (trailing space)
by BrowserUk (Patriarch) on Dec 16, 2011 at 21:02 UTC
    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?