lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 Nov 2007 10:17:55 +0200
From:	Benny Halevy <bhalevy@...asas.com>
To:	Chris Snook <csnook@...hat.com>
CC:	lkml <linux-kernel@...r.kernel.org>
Subject: Re: Coding Style: indenting with tabs vs. spaces

On Nov. 08, 2007, 17:58 +0200, Chris Snook <csnook@...hat.com> wrote:
> 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.

Yup, that's a valid convention, as long as there are no trailing spaces after that
extra tab stop.  Concatenating spaces to this one extra tab stop (as checkpatch
allows for up to 7 spaces) for decoration works well just as long as everybody
expand tabs the same way.

Benny

> 
> 	-- Chris
> -

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ