[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Request For Comments: 3-space indentation style
- From: William Ahern <william@...>
- Date: Mon, 6 Jan 2014 13:27:06 -0800
On Mon, Jan 06, 2014 at 11:03:33AM +0000, Craig Barnes wrote:
> On 5 January 2014 20:45, William Ahern <william@25thandclement.com> wrote:
> > Indentation and alignment are two separate issues. We can _all_ agree that
> > blocks should be indented, just not what the width should be. Use tabs and
> > _every_ can be made happy by setting their tab stop.
> >
> > If you prefer a particular alignment when wrapping statements, expressions,
> > and comments, then align them--using spaces. It's far easier for people to
> > deal with quirky alignments then it is to deal with quirky and annoying
> > indentation. And because alignments can be very complex--with invariably
> > corner cases that require you to violate your own rules--editors do a
> > horrible job of reflowing alignments of complex statements, so better to
> > just disable that feature (please!).
> >
> > If you use tabs for indentation and spaces for alignment, then when people
> > change their tab stop your alignment will still magically work.
> >
>
> Except that as soon as your code has tabs in it, all bets are off for aligning
> anything. A tab is a variable-width character and is incompatible with
> the notion of monospace alignment. It might seem to work so long as you
> always view it in the same editor with the same tab width, but it'll surely
> break as soon as someone views it with a different tab width.
If you use tabs for indentation and spaces for alignment, then your tab stop
is inconsequential. No matter your tab stop, anything you align within an
indented block will stay aligned.
Indentation always comes on the left-hand side. Anything you align inside of
a block will always have the same number of tabs, and will always shift
right or left as one block. It will all remain aligned correctly.
For example, take an ASCII art picture. If you insert an equal number of
tabs at the left, the picture will remain aligned, just shifted over. The
tab stop won't magically take it out of alignment.
- References:
- Request For Comments: 3-space indentation style, immerrr again
- Re: Request For Comments: 3-space indentation style, Tim Hill
- Re: Request For Comments: 3-space indentation style, David Given
- Re: Request For Comments: 3-space indentation style, steve donovan
- Re: Request For Comments: 3-space indentation style, Hisham
- Re: Request For Comments: 3-space indentation style, Jorge
- Re: Request For Comments: 3-space indentation style, Andrew Starks
- Re: Request For Comments: 3-space indentation style, phlnc8
- Re: Request For Comments: 3-space indentation style, William Ahern
- Re: Request For Comments: 3-space indentation style, Craig Barnes