[Gluster-devel] if/else coding style :-)

Shyam srangana at redhat.com
Mon Oct 13 20:46:08 UTC 2014


On 10/13/2014 04:34 PM, Jeff Darcy wrote:
> ----- Original Message -----
>
>> +1 to existing Linux kernel style. Moreover, its a style which is used
>> heavily in existing code base. I don't see any advantage in changing the
>> style now.
>
> It's not a change. It's already common in our code, if not actually the *most* common style.
>
> % find . -name '*.c' | xargs grep '} else {' | wc -l
> 1284
> jeff at odroid3 ~/glusterfs (nsr-design)
> % find . -name '*.c' | xargs grep 'else {' | wc -l
> 1431

Jeff, the above would include the references for "} else {" as well, so 
ideally it would be something like, 1431 - 1284 = 147 references to the 
other (non-kernel?) style.

Jut tried removing the 'wc -l' pipe and saw the same. So currently based 
on this method the metric for "} else {" should be the preferred one 
(just stating), or I am doing something wrong at my end :)

Shyam


More information about the Gluster-devel mailing list