[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0706152228400.32724@fbirervta.pbzchgretzou.qr>
Date: Fri, 15 Jun 2007 22:35:01 +0200 (CEST)
From: Jan Engelhardt <jengelh@...putergmbh.de>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: Cyrill Gorcunov <gorcunov@...il.com>,
"Kok, Auke" <auke-jan.h.kok@...el.com>,
Randy Dunlap <randy.dunlap@...cle.com>,
Chris Friesen <cfriesen@...tel.com>,
dave young <hidave.darkstar@...il.com>,
Willy Tarreau <w@....eu>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: coding style
On Jun 15 2007 13:21, Linus Torvalds wrote:
>On Fri, 15 Jun 2007, Cyrill Gorcunov wrote:
>> |
>> | from CodingStyle:
>> | Tabs are 8 characters, and thus indentations are also 8
>> | characters. There are heretic movements that try to make
>> | indentations 4 (or even 2!) characters deep, and that is akin
>> | to trying to define the value of PI to be 3.
>> |
>> | Linus (did he wrote that part?) and the heretics both can have their fun
>> | without impacting each other. If we wanted to force the user to have
>> | exactly 8 screen blanks, we should use spaces throughout.
>
>I did indeed write that.
>
>Tabs are 8 characters in the kernel coding style.
That clarification ("in the kernel coding style") should end up in
CodingStyle. (Since tabs *are not* just 8 everywhere, which current
CodingStyle seems to imply. But maybe I'm just to blunt.)
>And yes, I also wrote the other quote:
>
>> Now, some people will claim that having 8-character indentations makes
>> the code move too far to the right, and makes it hard to read on a
>> 80-character terminal screen. The answer to that is that if you need
>> more than 3 levels of indentation, you're screwed anyway, and should fix
>> your program.
>
>In the kernel, we try to split functions up, and perhaps use inline
>functions etc, and really really avoid deep indentation.
This rule is also very helpful outside the kernel.
Jan
--
(And IMHO, GNU code, e.g. coreutils, is the best counter-example.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists