[SM-Discuss] Request for comments - formating in spells

Thomas Orgis thomas-forum at orgis.org
Tue Jul 22 08:23:46 EDT 2008


Am Tue, 22 Jul 2008 08:05:08 -0400
schrieb flux <flux at sourcemage.org>: 

> > 2)
> > BUILD file when not default tends to be aligned on some conditional clauses
> > and end of line with configure and options:
> > if [[ foo == bar ]; then
> > [tab]./configure --opt1 \
> > [tab]            --opt2 \
> > [tab]            --opt3 &&
> > [tab]make
> > fi
> > 
> > ([tab] means tab and " " space means space... so in the above lines there's
> > only one tab...)
> There is a new issue that comes up with tabs: not everyone has tabs set
> to the same width, so the formatting will be different on different
> screens

This replique comes two-fold:

1. Standard pro-TAB rant.

No. It will always be the same width of indent. No matter how wide your
Tab setting is, you always have one level of indent per tab. Two tabs
stay two tabs. Always (with indendation, that is).
The formatting is consistent.
That is the beauty of it: You please people with different tastes about
the width of an indendation step without any loss in consistency of the
file. You do not want to say "oh, this line should begin after two
leading spaces", you want to say "this line has one level of indendation".
What people always mess up is the idea of aligning stuff on a
per-character basis using tabs. That is bullshit.
You can line up tabs only with tabs. When you realize that a tab has no
definite width, you have no problem with different tab widths...
For fancy formatting you use spaces _after_the_indent_ (ignoring the
fact that there are indeed people who do _not_ use fixed-width fonts;-).

2. Pragmatic insight with respect to shell scripting.

For the case of Bash scripts, I hit a simple fact that is slowly
convincing me _not_ to use tabs in shell scripts at all:
When I want to test a block of shell code by simply pasting it into a
terminal, the tabs get pasted also -- and transform from harmless
whitespace to massive word completion triggering!
Though I really dislike having to use a certain number of spaces for
indent (as one space really is a bit tight), this is a strong argument
for me to shun tabs in shell scripts altogether (not just for indent).
Note, though, that I use tabs for indent in all my other coding...

> Tabspacing can be redefined in the different editors, but I have a
> feeling we will end up in a war about tabspacing... "8 is best! No 4 is
> best! You're all losers, 2! WTF, 5!" ad nauseum.

The whole point is that you do _not_ have to agree to a tab width --
unless when you mean "x spaces written to file when I type TAB".


Alrighty then,

Thomas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/sm-discuss/attachments/20080722/b4c857c6/attachment.bin 


More information about the SM-Discuss mailing list