lkml.org 
[lkml]   [2007]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Coding Style: indenting with tabs vs. spaces
Benny Halevy wrote:
> Greetings,
>
> I would like to hear peoples opinion about the indentation convention
> described below that I personally found the most practical with
> several different editors.
>
> The gist of it is that tabs should be used for nesting, not for decoration.
> Indent your code with as many tabs as your nesting level, where all statements
> will begin, and from there on use space characters.
> The rational behind it is to be tab-width agnostic so regardless of your
> tab expansion setup, the code will look correct and will make sense.
>
> When you break a line and want the new line text to start below a specific point
> relative to the previous line (I consider that "decorating") then start the new
> line with the same number of tabs as the previous one and then just use space
> characters as their width is the same as any character in the previous line,
> (assuming fixed-width fonts of course).

I find it meaningful to indent extended lines one extra tab stop, but beyond
that I agree it is just decoration.

-- Chris
-
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: 2007-11-08 17:05    [W:0.053 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site