[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Indenting styles (was Re: dpkg-scanlibs)



On Tue, Feb 27, 2001 at 10:04:16AM -0800, John H. Robinson, IV wrote:
> On Mon, Feb 26, 2001 at 06:12:50PM -0700, Jason Gunthorpe wrote:
> > 
> > IMHO the whole tab argument really only hold water if your indenting is
> > very simple, or you ignoe vertical alignment. Ie this in C:
> > 
> >    char *List[] = {"Hello",
> >                    "Mooo",
> >                    0};
> 
> [tab]	char *List[] =
> [tab]	{
> [tab]	[tab]	"Hello",
> [tab]	[tab]	"Mooo",
> [tab]	[tab]	0
> [tab]	};
> 
> this keeps the {}'s lined up very nicely.

Indeed, but is 6 lines, not 3.  Not a problem for array initialisers, but
consider also:

myQuiteLongFunctionNameWithManyArgs("asdgafgsd",
                                    "asdfasdfas",4,5,'c',
                                    "klkmlkm);

...which is a nice identation style, IMO, and is better at 3 lines
than 6. However, I agree with the person in this thread who said 'tabs 
for indentation, spaces for alignment'. And as for the bookkeeping
that might involve: teach your editor to do it right.

Or use indent or another similar tool ;-)

Jules



Reply to: