LWN.net Logo

CodingStyle: relax the 80-cole rule

From:  Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>
To:  git-commits-head-AT-vger.kernel.org
Subject:  CodingStyle: relax the 80-cole rule
Date:  Wed, 17 Oct 2007 16:01:45 GMT
Message-ID:  <200710171601.l9HG1jIJ023207@hera.kernel.org>
Archive-link:  Article, Thread

Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/li...
Commit:     dff4982f5cd4e30e2a140a3bca95d8814115bf5b
Parent:     9c6cdad7fee1630941cdd9d74ec310632a9e5c93
Author:     Alan Cox <alan@lxorguk.ukuu.org.uk>
AuthorDate: Tue Oct 16 23:27:33 2007 -0700
Committer:  Linus Torvalds <torvalds@woody.linux-foundation.org>
CommitDate: Wed Oct 17 08:42:55 2007 -0700

    CodingStyle: relax the 80-cole rule
    
    I would suggest this change to make CodingStyle properly reflect the style
    used by the kernel, rather than the current wording which is wishful
    thinking and misleading, and comes from the same school of thought that
    gets off on prescriptive grammar, latin and comp.std.c
    
    Signed-off-by: Alan Cox <alan@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 Documentation/CodingStyle |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 7f1730f..6caa146 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -77,12 +77,15 @@ Get a decent editor and don't leave whitespace at the end of lines.
 Coding style is all about readability and maintainability using commonly
 available tools.
 
-The limit on the length of lines is 80 columns and this is a hard limit.
+The limit on the length of lines is 80 columns and this is a strongly
+preferred limit.
 
 Statements longer than 80 columns will be broken into sensible chunks.
 Descendants are always substantially shorter than the parent and are placed
 substantially to the right. The same applies to function headers with a long
-argument list. Long strings are as well broken into shorter strings.
+argument list. Long strings are as well broken into shorter strings. The
+only exception to this is where exceeding 80 columns significantly increases
+readability and does not hide information.
 
 void fun(int a, int b, int c)
 {


(Log in to post comments)

And the next patch will be ...

Posted Oct 18, 2007 20:22 UTC (Thu) by proski (subscriber, #104) [Link]


-The limit on the length of lines is 80 columns and this is a strongly
-preferred limit.
+The limit on the length of lines is 80 columns and this is a preferred limit unless you have some really good reason to use mode columns in your code.
:)

And the next patch will be ...

Posted Oct 19, 2007 2:19 UTC (Fri) by aya (guest, #19767) [Link]

I was really hoping that particular patch bumped it up to 81 columns ... ah well.

And the next patch will be ...

Posted Oct 19, 2007 16:23 UTC (Fri) by sayler (subscriber, #3164) [Link]

nice!  It was cut off in my browser window!  :D

Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds