Re: Tabs, spaces, indent and 80 character lines
- From: Richard Knutsson <ricknu-0@xxxxxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 22:40:41 +0100
Benny Halevy wrote:
On Feb. 24, 2008, 7:40 -0800, Richard Knutsson <ricknu-0@xxxxxxxxxxxxxx> wrote:Don't know what to say more then: Yup! :)
Krzysztof Halasa wrote:
Richard Knutsson <ricknu-0@xxxxxxxxxxxxxx> writes:You mean for split lines? Hopefully there won't be that many, so there is just to delete the tabs it added and replace it with spaces.
Why hinder a developer who preferI guess we could use tabs only at the line start, for indentation
2, 4, 6 or any other != 8 width?
only. Rather hard to implement, most text editors can't do that yet.
IMO, tabs SHOULD be used for syntactic indentation and spaces for
decoration purpose only. I.e. a line should start with a number of tabs
equal to its nesting level and after that only spaces should be used.
for example, the following code
for (i = 0; i < n; i++) printk("a very long format string", some, parameters);
should be formatted like this:
<tabs...>for (i = 0; i < n; i++)
<tabs...><tab>printk("a very long format string",
<tabs...><tab> some, parameters);
this will show exactly right regardless of your editor's tab expansion setting
as long as you use fixed-width fonts - where the screen width of the space character
is equal to all other characters. Once you start using tabs instead of spaces
to push text right so it appears exactly below some other text on the line above
you make a dependency on *your* editor's tab expansion policy and that's not very
considerate for folks who prefer a different one.
But the CodeStyle-document and checkpatch.pl does not agree with that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: Tabs, spaces, indent and 80 character lines
- From: Benny Halevy
- Re: Tabs, spaces, indent and 80 character lines
- References:
- Tabs, spaces, indent and 80 character lines
- From: Richard Knutsson
- Re: Tabs, spaces, indent and 80 character lines
- From: Krzysztof Halasa
- Re: Tabs, spaces, indent and 80 character lines
- From: Richard Knutsson
- Re: Tabs, spaces, indent and 80 character lines
- From: Benny Halevy
- Tabs, spaces, indent and 80 character lines
- Prev by Date: Re: net: tx timeouts with skge, 8139too, dmfe drivers/NICs
- Next by Date: [PATCH 1/2] [W1] ds1wm: should check for IS_ERR(clk) instead of NULL
- Previous by thread: Re: Tabs, spaces, indent and 80 character lines
- Next by thread: Re: Tabs, spaces, indent and 80 character lines
- Index(es):
Relevant Pages
|