On Mon, Apr 11, 2016 at 11:29:17AM -0300, Christian Franke wrote: > 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.
I haven't checked if the majority do or not. Seems pretty much only things hosted by the FSF uses GNU style though. Grub comes to mind. > 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. Certainly the GNU style is one of the most annoying styles to write in (Although I guess emacs users don't have to worry about it since I think emacs takes care of it for them) and certainly among the least readable and most wasteful of vertical space. I like projects to keep one consistent style in their code and would not tell any to change their style if they are already consistent, but I sure do have the GNU style. I would think either everything has to stay with the current style, or everything has to change to a new style. Allowing two at the same time is a mess. -- Len Sorensen _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
