[lkml]   [2008]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Merging of completely unreviewed drivers

On Fri, 22 Feb 2008, Al Viro wrote:
> ... if your style is lousy. I agree that situation with printks is
> not normal in that respect and I certainly have no love for the
> checkpatch nonsense, but pressure to keep the fucking nesting depth
> low is a Good Thing(tm).

I do agree, but that has little to do with line length *directly*.

IOW, I'd personally be happier with a checkpatch that calculated
"complexity" and indentation over line length.

There is definitely a correlation there: there is no question that complex
lines with deep indentation tend to be long. So yes, "long lines are
correlated with bad code" is certainly true to some degree.

But sometimes lines are long just because it's a function call with
multiple parameters, and it's just three levels indented, and it had a
string there too. It may be long, but it's not complex, and keeping it on
one line actually makes it much easier to visually parse (and grep for,
for that matter).

So I'd be happier with warnings about deep indentation (but how do you
count it? Will people then try to fake things out by using 4-space indents
and then "deep" indentations will look like just a couple of tabs?) and
against complex expressions (ie "if ((a = xyz()) == NULL) .." should just
be split up into "a = xyz(); if (!a) ..", but there are sometimes reasons
for those things too!


 \ /
  Last update: 2008-02-22 04:17    [W:0.135 / U:0.844 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site