On Friday 08 June 2007, John Stoffel wrote:
> Jeff> On Thu, Jun 07, 2007 at 09:56:06PM -0400, John Stoffel wrote:
> >> Thinking about it more, I wonder if Krysztof is bitching more about
> >> the tab width of 8 characters? I know that it ticks me off,
>
> Jeff> Even if he is, _that_ is definitely not getting changed.
>
> Oh sure... I know that part is written in stone.
Yes, and as a person doing Linux code review for 12 years now,
I'm really thankful for it. 8 char tab, 80 column rule and 25-50 lines
of code per function actually enable effective review of code snippets.
Because you can see more code flow per patch.
And enables high code reuse. If you can get within 1-5min,
what a functions does and match it with your actually
written down last 20 code lines, you just reuse it more often.
If you have more to choose from, you reuse naturally.
Personally I find best candidates by code position in tree and
function signature.
> Jeff> If code starts creeping way right due to indentation levels,
> Jeff> create a new function.
>
> Sure... compilers are good, us humans haven't gotten much better, make
> it easier on us and harder on the computer.
Yes, let compile remove all the abstraction overhead.
GCC does a pretty good job there, I think.
I recently analyzed some code and it took much, much longer (factor 2-3),
because of laxer coding rules similiar to the ones you suggest.
I even asked the developers, who wrote that code and to ones who work
daily with that code base and they had the same problems. They all couldn't
explain the "Why?" only the "How?". Not to mention, that this was a core
component.
After refactoring some big messy parts into smaller functions,
identical, missing, unhandled cases became visible, inappropriate usages
were identified and even some loops could be removed.
Now try to find such problems within Linux. They should be a small percentage
and not within core components.
So a big THANKS to all the code cops here: You actually make the
damn fast change rate of Linux possible by keeping the base clean
and neat.
Best Regards
Ingo oeser
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]