lua-users home
lua-l archive

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


I think this is splitting into two issues: how much to indent and how to indent.

Seeing there is no agreement about 2 or 3 or 4 (not surprised :-)) how about following the K&R C book and use 5? I personally prefer 4.

How to do it is a bit easier in emacs as you can yourself choose if you want to indent with tabs + spaces or just spaces. I would personally prefer not to have mode which itself changes the tab stops, leave them at 8 like most other modes. If people want to change tab stops let them do so but request they add an emacs comment at the beginning of the file which does it.

Robert



On 6 January 2014 18:36, Marc Lepage <mlepage@antimeta.com> wrote:
I used to use tab and advocate tab over spaces on the argument that we could:

1) Agree how much a tab indents.
2) Set our tab stops to that setting.
3) Not infect our tabs with spaces.

I thought 1 would be the hard part and 2,3 would be easy. So having agreed on 4 spaces, I thought the rest was just simple mechanical action and there was no reason not to use tabs.

Not so.

After working at a variety of places with a variety of people over the years, I have come around to using spaces only for indentation and alignment. Experience has taught me that invariably people cannot use tabs properly, at least consistently enough for it to be worthwhile. It's much easier to go with spaces.

If I were on my own or working with like people, I'd use tabs. But I think it's safe to assume spaces are what average people can handle.


On Mon, Jan 6, 2014 at 6:03 AM, Craig Barnes <craigbarnes85@gmail.com> 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.