[Ffmpeg-devel] [PATCH] from DivX, Part 1: cosmectic changes

The Wanderer inverseparadox
Thu Dec 22 23:16:59 CET 2005


On 12/22/2005 01:13 PM, Diego Biurrun wrote:

> On Thu, Dec 22, 2005 at 12:12:11PM -0500, The Wanderer wrote:
> 
>> On 12/22/2005 09:34 AM, Diego Biurrun wrote:

>>> I just repeated
>>> 
>>>   find . -exec sed -i -e 's/ *$//' -e 's/	*$//' {} \;
>>> 
>>> a few times to remove all trailing whitespace.
>> 
>> Hmm. How does that fail to remove whitespace on lines which consist
>> only of whitespace?
> 
> It does not fail; by design, not by accident.

The only benefit I can see to removing that whitespace is slightly
smaller source files; the only benefit I can see to keeping them is the
one of convenience I referred to (see below). I would probably have
considered the latter to outweigh the former, but you may feel
differently.

>> I do not consider those to be "trailing whitespace";
> 
> Then reconsider, since it falls under the definition of trailing 
> whitespce for pretty much the rest of the world.

(Note: I'm not pushing to have things changed, this is purely an
academic discussion for me; I noticed this behaviour when looking at
checktree.sh and was curious then, but no one commented.)

> Every whitespace character after the last non-whitespace character on
> a line is trailing whitespace.  If the number of non-whitespace
> characters on a line happens to be zero, then all the whitespace on
> that line is trailing.

I disagree with this last sentence. In order for it to be considered
"trailing whitespace", there must be something on the line for it to
trail after. If there is nothing there, then it exists independently.

>> they exist for convenience of indentation, and I'd be bothered by
>> trying to work with code which did not have them there.
> 
> Huh?

Where there are two lines of code with the same level of indentation,
and there is a blank line between them, then when moving the cursor (or
what-have-you) from one of the indented lines to the blank one I
ordinarily expect to have it indented as far as the beginning of the two
lines of code - so that I do not have to insert it manually in order to
add further code (or a comment) there. The whitespace accomplishes this.

As I said, it's a matter of convenience - but for most of the segment of
my life in which I have been remotely familiar with the concept of
programming, it was a convenience I took for granted; it had literally
never occurred to me that it might be omitted.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.





More information about the ffmpeg-devel mailing list