I agree, the GNU coding style is a bit counter-intuitive.  Not sure that I
care a whole lot though.  I'll try to stick to the style in the current
file I am working on.

About the only thing I do care about is the use of curly-braces, and
frankly I don't think I'm ever going to convince anyone to change :).  The
style of not always 100% of the time using curly braces annoys me and I
think it leads to easily avoidable bugs( ala the ripd bug I fixed on friday
night is a great example ).

donald

On Mon, Apr 11, 2016 at 10:29 AM, Christian Franke <
ch...@opensourcerouting.org> wrote:

> On 04/11/2016 07:58 AM, Paul Jakma wrote:
> > On Thu, 31 Mar 2016, David Lamparter wrote:
> >> FWIW, I would go further and accept Linux style on a per-file basis in
> >> other
> >> parts of Quagga.
> >
> > I'd rather leave it at GNU style being the default and recommended for
> > the project [...] Different style everywhere is just jarring though and
> > that annoys me the most - switching is annoying both on typing and
> > reading.
>
> Given that the majority of other projects seems to be using kernel
> style, at least that is what I encounter for almost anything other than
> Quagga, I would prefer if we could allow for the kernel style to be used
> in Quagga. The argument of consistency could also be made to the point
> that it would be useful if people could constistently write code in the
> style which they are accustomed to. At least to me, this kind of
> consistenency would provide much more value than to consistently use the
> traditional coding style of Quagga.
>
> Therefore, I think that David's suggested change is a good compromise
> between keeping the coding style of existing code consistent and to
> allow new contributions to be made in a way that allows people to think
> about the code they write, instead of its style.
>
> -Christian
>
> ps> I find the GNU coding style much less readable than the Kernel
> coding style: With GNU style, the curly braces of control structures are
> shifted by 2 spaces in relation to code, while code itself is shifted by
> a width of 4 unless the block is not using braces in which case it is
> only indented by 2.
> Given this irregularity of indentation levels and their small width, I
> often cannot easily discern the overall structure of a function in many
> cases where multiple control structures like loops and if statements are
> nested, especially if there are long code blocks and/or control
> structures are closed in short succession.
>
> In contrast to that, kernel style uses a consistent indentation of one
> tab, equaling 8 spaces. Indentation of code does not depend on whether
> its containing control structure is using braces. Also, by indenting
> with a shiftwidth of 8, the creation of megamoths, which quagga has
> quite some of, is discouraged, which I believe to be a good thing.
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to