Compare source code

Tim Harig usernet at ilthio.net
Fri Nov 5 19:02:45 CET 2010


On 2010-11-05, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> On Thu, 04 Nov 2010 21:47:59 +0000, Tim Harig wrote:
>
>> I have seen huge patches caused by nothing more then some edit that
>> accidently added a trailing space to a large number of lines.  White
>> space mangling happens all the time without people even knowing about
>> it.
>
> How does an edit accidentally add a trailing space to a large number of 
> lines?

Putting it back in context, it doesn't matter.  Seeb's point stands.
diff -b was designed because there are so many tools and channels that
mangle whitespace.  Changes in something such as brace style would make
non-whitespace changes that would not be eliminated by diff -b.

Probably the biggest reason for -b is for handling the differences in line
endings used on different platforms.

> (1) The programmer shifted the cursor to the end of the line, pressed 
> space, moved down a line, shift to eol, press space, repeat a large 
> number of times. I don't call that an "accident".

A search and replace operation could easily add extra whitespace and since
whitespace is not normally visible, the changes most likely go unnoticed.
The bottom line is that it happens and assigning blame really doesn't
change that fact.

> (2) Some programmer used a tool that thought it was okay to add 
> whitespace to the end of lines without being told to. I don't call that 
> an accident either, I call that using a broken tool.

Yep, there are probably thousands of tools that mangle whitespace.  In many
cases, such as differences in line endings, what they are doing is not even
wrong.  You can blame the tools all you like; but, they are not going away.

You keep trying to tell us that using whitespace is superior; but,
other languages manage to work with these thousands of imperfect
tools without issue.  The use of whitespace was a stylistic change and
stylistic holy wars exist because it is almost impossible to prove that
any reasonable style has benefit over another.  That whitespace causes
issues is verifiable.  I find it hard to concluded that that whitespace
based syntax is superior when it tells us that we cannot use thousands
of otherwise useful tools that other langauges manage to work with.
I find it hard to select a matter of taste with no verifiable benefit
over a verifiable disadvantage that happens to strike many people.



More information about the Python-list mailing list