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

2014-10-14 Thread Kaleb KEITHLEY
[~/work/glusterfs] sh$ git grep '} else {' | wc -l 1331 [~/work/glusterfs] sh$ git grep 'else {' | grep -v '}' | wc -l 142 So going by just numbers, } else { is 10x more common than }\n else {. I also find that believable based on familiarity of seeing this pattern in the code.

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

2014-10-14 Thread Niels de Vos
On Tue, Oct 14, 2014 at 07:42:54AM -0400, Kaleb KEITHLEY wrote: [~/work/glusterfs] sh$ git grep '} else {' | wc -l 1331 [~/work/glusterfs] sh$ git grep 'else {' | grep -v '}' | wc -l 142 So going by just numbers, } else { is 10x more common than }\n else {. I also find

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

2014-10-14 Thread Justin Clift
- Original Message - Without taking sides: the last grep is including else without either { or }. [~/work/glusterfs] sh$ git grep '} else {' | wc -l 1331 [~/work/glusterfs] sh$ git grep 'else {' | grep -v '}' | wc -l 142 So going by just numbers, } else { is 10x more

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

2014-10-13 Thread Shyam
On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote: hi, Why are we moving away from this coding style?: if (x) { /*code*/ } else { /* code */ } This patch (in master) introduces the same and explains why, commit 0a8371bdfdd88e662d09def717cc0b822feb64e8 Author: Jeff Darcy

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

2014-10-13 Thread Pranith Kumar Karampuri
On 10/13/2014 07:27 PM, Shyam wrote: On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote: hi, Why are we moving away from this coding style?: if (x) { /*code*/ } else { /* code */ } This patch (in master) introduces the same and explains why, commit

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

2014-10-13 Thread Shyam
On 10/13/2014 10:08 AM, Pranith Kumar Karampuri wrote: On 10/13/2014 07:27 PM, Shyam wrote: On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote: hi, Why are we moving away from this coding style?: if (x) { /*code*/ } else { /* code */ } This patch (in master) introduces the same and

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

2014-10-13 Thread Dan Lambright
Subject: Re: [Gluster-devel] if/else coding style :-) On 10/13/2014 10:08 AM, Pranith Kumar Karampuri wrote: On 10/13/2014 07:27 PM, Shyam wrote: On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote: hi, Why are we moving away from this coding style?: if (x) { /*code

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

2014-10-13 Thread Pranith Kumar Karampuri
On 10/13/2014 07:43 PM, Shyam wrote: On 10/13/2014 10:08 AM, Pranith Kumar Karampuri wrote: On 10/13/2014 07:27 PM, Shyam wrote: On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote: hi, Why are we moving away from this coding style?: if (x) { /*code*/ } else { /* code */ } This

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

2014-10-13 Thread Kaleb S. KEITHLEY
top post ISTR we agreed to use Linux kernel style! Which is if (foo) { /* ... */ } else { /* ... */ } I don't recall any discussion on -devel about changing this. /top post On 10/13/2014 11:05 AM, Pranith Kumar Karampuri wrote: On 10/13/2014 07:43 PM, Shyam wrote:

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

2014-10-13 Thread Jeff Darcy
I urge you guys to notify others before making basic style changes like this. Yes, all style changes - including the one being enforced by the original version of checkpatch.pl - should be submitted for review. ___ Gluster-devel mailing list

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

2014-10-13 Thread Jeff Darcy
- 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 .

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

2014-10-13 Thread Shyam
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

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

2014-10-13 Thread Joe Julian
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

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

2014-10-13 Thread Shyam
(apologies, last one on the metrics from me :), as I believe it is more about style than actual numbers at a point) _maybe_ this is better, and it is pretty close to call now ;) find -name '*.c' | xargs grep else | wc -l 3719 find -name '*.c' | xargs grep else | grep '}' | wc -l 1986 find

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

2014-10-13 Thread Anand Avati
On Mon, Oct 13, 2014 at 2:00 PM, Shyam srang...@redhat.com wrote: (apologies, last one on the metrics from me :), as I believe it is more about style than actual numbers at a point) _maybe_ this is better, and it is pretty close to call now ;) find -name '*.c' | xargs grep else | wc -l

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

2014-10-13 Thread Jeff Darcy
Without taking sides: the last grep is including else without either { or }. That's true. I stand corrected. ___ Gluster-devel mailing list Gluster-devel@gluster.org http://supercolony.gluster.org/mailman/listinfo/gluster-devel