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

Joe Julian joe at julianfamily.org
Mon Oct 13 20:52:30 UTC 2014


Not taking sides, though if I were I would support the kernel style 
because I, personally, find it easier to read. Just to clarify the point:
$ find -name '*.c' | xargs grep '} else {' |  wc -l
1284
$ find -name '*.c' | xargs grep else | grep -v '}' | wc -l
1646

On 10/13/2014 01:46 PM, Shyam wrote:
> 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
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://supercolony.gluster.org/mailman/listinfo/gluster-devel



More information about the Gluster-devel mailing list