[asterisk-dev] Re: [svn-commits] trunk r32971 -
/trunk/include/asterisk.h
Steven Critchfield
critch at basesys.com
Fri Jun 9 08:37:40 MST 2006
On Thu, 2006-06-08 at 19:47 +0000, Tony Mountifield wrote:
> In article <18838486.21281149778124766.JavaMail.root at jupiler.digium.com>,
> Russell Bryant <russell at digium.com> wrote:
> > As stated in the coding guidelines, when using inline comments, please use spaces for
> > indentation instead of tabs. Otherwise, we will keep getting formatting patches from people
> > because it doesn't look right when displaying tabs differently than the last person editing
> > this code.
>
> That doesn't actually help in all cases.
>
> If you have inline comments on lines with different indentation, they
> will still align differently depending on the expansion size of the
> initial tabs on each line.
>
> I think the main problem is that the coding guidelines specify a hard tab
> size of 4, but many people (myself included) set hard tabs at the default
> of 8. I would prefer indent options of "-i4 -ts8", which translate into
> vim options of "sw=4 sts=4 ts=8".
I don't want to start a flame war on formatting. Especially when my
reading of the above may be flawed. But whose default is 8 for tab
stops? In vim under Debian, tabs are set to 4. So to me the default
would be 4 not 8. I'm sure there are others out there that do other
numbers as well. YAML seemed to pick an odd format to me when they chose
2 spaces for indentation.
Your point though is right that when you mix tabs at the begining and
spaces or tabs at the end, the comments may not line up right.
So the question I have is, should same line comments be kept to a
minimum and the default to be to use a new line for comments. This
should render the formatting of comments and code immune to tabstop
choices.
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-dev
mailing list