[darcs-users] trailing whitespace

Eric Kow kowey at darcs.net
Wed May 13 01:37:13 UTC 2009


I'm certainly happy to have your feedback and better yet, your criticism
on darcs.

On Sat, May 09, 2009 at 22:26:09 -0700, Jason Dagit wrote:
> One thing that I've always found to be a misfeature of darcs, is that it
> displays trailing white space.

Whether or not we believe that one should be comment on trailing
whitespace during patch review, I think this is a useful feature to have
because it avoids mystery hunks, things that give the user the
impression of spurious changes in the output.  In other words, as a
user, I personally would find this block a bit surprising:

-foo    
+foo 

And this block less so:
-foo    [_$_]
+foo [_$_]

Because it tells me explicitly why the hunk is there.  I'm not sure what
the other use cases are for displaying this, but I claim that it is
useful for the cases where only trailing whitespace has changed.

Also another reason is that there may be applications for which the
trailing whitespace is meaningful.

> I'll be frank in that I cannot understand why trailing white space
> even matters to people.

One reason is that we want to avoid creating diffs in which the only
thing that has changed is the whitespace.  A way to achieve this would
be to have no trailing whitespace whatsoever and then systematically zap
any whitespace that enters.  It doesn't mean we have to reject patches
with trailing whitespace, either, although we could always make a remark
on this fact to minimise zappage.

Another minor reason to avoid it is that accidental whitespace-only
lines tell certain text editors that the two adjacent paragraphs are
actually just one, which can be annoying for people who use
paragraph-based navigation to jump around text or source files. 

These aren't very strong reasons, which is fine.

Really it's a non-issue.  This is on the level of a pet peeve for me
more than anything else, and I'll be the first to admit that I'm not
entirely clear on why it bugs me.  Luckily, it's not the kind of thing
that lends itself to holy wars because as far as I know, nobody claims
that trailing whitespace in code is a good thing, just that it's not
enough of a nuisance to worry about or that it is.  It may lead to
policy discussions such as this one, but really the level of drama is
minimal.

> I probably just started a bikeshed, but I feel strongly that caring
> about trailing whitespace is misdirected energy.  If someone wants to
> be detail oriented *and* useful, I think they should do something that
> improves the documentation or fixes a bug in darcs.  But, using detail
> orientation at this level is just annoying :)

Sure, I see pointing out whitespace as a vice on my part, but then
again, I think that just making it something systematic (e.g. with
the help of the policy regression test) and matter-of-fact will
make it less energy intensive.  As it stands, it's the kind of thing
I can do with little investment, and that sort of thing is handy.

What happens is that I notice the red dollar sign as I apply the
patch, so I mention it.

I figure is that this gives us a minuscule improvement in the code for a
commensurately minuscule amount of effort, which neither detracts from
my review time nor significantly increase list noise.  Sure, it adds a
paragraph, but most of that is self-consciousness on my part because I
do understand my whitespace remarks to be mostly a vice, but as I become
less self-conscious about it, it'll just be a quick one-liner: please
avoid adding trailing whitespace <link>.
 
> Sorry, Eric that I'm picking on you.  It's not about you, I just think
> the practice of auditing trailing white space is not an effective
> habbit.  I hope I'm not sounding too harsh.  I appreciate attention to
> detail usually :)

:-)

I'm happy to do what darcs-users tells me to do.  If more people
complain, fine, we can ignore trailing whitespace too.  If not, I'm
going with my one-liners.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090512/ed6b951c/attachment.pgp>


More information about the darcs-users mailing list