Re: PATCH, RFC: 2.6 Documentation/Codingstyle

From: Michael Frank
Date: Fri Feb 13 2004 - 05:42:02 EST


On Friday 13 February 2004 18:09, Nick Piggin wrote:
>
> Michael Frank wrote:
>
> >On Friday 13 February 2004 17:10, Andrew Morton wrote:
> >
> >>
> >>Yes, 80 cols sucks and the world would be a better place had CodingStyle
> >>mandated 96 columns five years ago. But it didn't happen.
> >>
> >>
> >
> >As to "five years ago", what about review the coding style situation before
> >starting 2.7:
> >
> >In view of better hardware, increasing linelength a little to 96 could be
> >considered without increasing the number of indentation levels.
> >
> >
>
> I hope not, I usually use 80 columns. Email's using 80 columns.
> And lines start becoming difficult for the eyes to follow as they
> get longer. Maybe this isn't so much a problem with C code due to
> indentation and the sparseness of the lines.
>

Just for consideration and nesting should _not_ be increased ;)

80 is quite OK but has not much margin and is asking for more lines
times with nesting of 3.

0 1 2 3 4 |<81

printk(KERN_WARNING "Warning this is a long printk with "
"3 parameters a: %u b: %u "
"c: %u \n", a, b, c);
next_statement;

printk(KERN_WARNING "Warning this is a long printk with "
"3 parameters a: %u b: %u "c: %u \n", a, b, c);
next_statement;

96 is not excessive and will reduce linecount and often makes things more readable.

0 1 2 3 4 |<97

printk(KERN_WARNING "Warning this is a long printk with 3 parameters "
"a: %u b: %u "c: %u \n", a, b, c);
next_statement;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/