Why is trailing whitespace a big deal?

Posted by EpsilonVector on Programmers See other posts from Programmers or by EpsilonVector
Published on 2011-11-24T17:56:57Z Indexed on 2011/11/24 18:17 UTC
Read the original article Hit count: 441

Filed under:
|

Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of it automatically, and many coding standards require you to eliminate all instances of it. I'm not entirely sure why though. I can think of one practical reason of avoiding unnecessary whitespace, and it is that if people are not careful about avoiding it, then they might change it in between commits, and then we get diffs polluted with seemingly unchanged lines, just because someone removed or added a space.

This already sounds like a pretty good reason to avoid it, but I do want to see if there's more to it than that. So, why is trailing whitespace such a big deal?

© Programmers or respective owner

Related posts about coding-style

Related posts about whitespace