Re: [CLEANUP PATCH RESEND] git wrapper: Make while loop more reader-friendly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 2009 January 02 12:49:53 Johannes Schindelin wrote:
> > > -	do
> > > -		--slash;
> > > -	while (cmd <= slash && !is_dir_sep(*slash));
> > > +	while (cmd <= slash && !is_dir_sep(*slash))
> > > +		slash--;
> >
> > I prefer the one-liner:
> > for (; cmd <= slash && !is_dir_sep(*slash); --slash);
>
> As I mentioned in the commit message: readability is something to be
> cherished and worshipped.

It's also subjective.  I think my one-line is more readable than your two 
lines which is only slightly more readable than the original 3 lines.  Or is 
there some objective readability metric that of which I'm just not aware?

I also think that the lack of braces around your body on a separate line makes 
it harder to read and easier to break, but I understand that is the git 
coding style.

> For your pleasure, I will not go into details about the motions my bowels
> went through when I looked at those three lines.  Or your single line, for
> that matter.

Please do, although privately if you like.  I really don't see the problem the 
patch is trying to fix.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@xxxxxxxxxxxxxxxxx                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux