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

Justin Clift justin at gluster.org
Tue Oct 14 21:01:36 UTC 2014


----- 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 common than "}\n else {".
> I also find that believable based on familiarity of seeing this pattern in
> the code. Either way, good idea to stick to one and not allow both in
> future code.

Meh, I'm going to take sides. :D

Let's go with the Linux Kernel style, as it's very familiar to many people
in our Community and is "good enough".

If we find it hard to decide, lets do an on-list vote (+1/-1 style) and
adjust checkpatch.pl as needed to enforce it. :)

Regards and best wishes,

Justin Clift

-- 
GlusterFS - http://www.gluster.org

An open source, distributed file system scaling to several
petabytes, and handling thousands of clients.

My personal twitter: twitter.com/realjustinclift


More information about the Gluster-devel mailing list