Why is it bad to check in lines with trailing whitespace to your source control? What kinds of problems could that cause?
Some editors automatically remove trailing whitespace, some don't. This creates diff noise and can cause merge conflicts. You should coordinate with the people you're working with (colleagues, open-source crowd) what strategy everybody is using and make sure you all use the same strategy.
Micro white space has a direct impact on content legibility. For example, marginal white space surrounding paragraphs affects the user's reading speed and comprehension. If text appears in margins outside regular paragraphs, people read it more slowly. They find it harder to understand than text without such margins.
Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline. In your posted question, there is one extra space after try: , and there are 12 extra spaces after pass : >>> post_text = '''\ ...
A leading space is a space that is located before the first character (letter, number, punctuation mark) in a text entry field. A trailing space is a space that is located after the final character in a text entry field.
False differences, basically. It's helpful if diffs only show "real" changes. Some diff programs will ignore whitespace, but it would be better just to avoid the dummy change in the first place.
Of course, it also doesn't help if it makes the line wrap on a colleague's machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With