lkml.org 
[lkml]   [2004]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: PATCH, RFC: 2.6 Documentation/Codingstyle

    On Fri, 13 Feb 2004, Andries Brouwer wrote:

    > I do. (That is, 80xN with N in 24..60 or so.)
    >
    > The 80 here has a pedagogical and a practical purpose.
    > The practical one is that it makes sure that everybody can read the source.
    > The pedagogical is to invite you to arrange the code in a different way
    > if you are nesting too deeply or your expressions are too complicated.

    Deeply nested doesn't mean unreadable or badly structured. 1 tab in the
    function, 1tab a switch, 1 if, 1 for, 1 if and you have already lost
    half of the available space. It's not difficult to find lines compressed
    towards the 79th column in the kernel sources.
    I propose to change "hard limit" to "soft limit" to avoid things like this:

    rc=idefloppy_begin_format(drive, inode,
    file,
    (int *)arg);

    IMO we should try to keep function calls on the same line. btw it's
    only a matter of taste and the compiler accepts ugly code too :))

    > There is also ergonomics. There is a reason newspapers do not print
    > text across the full width of the page - it would be very difficult
    > to read.

    Code has only one instruction per line.


    --
    Giuliano.

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

    \
     
     \ /
      Last update: 2005-03-22 14:00    [W:0.023 / U:93.248 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site