Formatting of bootscripts

Bryan Kadzban bryan at kadzban.is-a-geek.net
Tue Jan 4 10:14:30 PST 2005


On Tue, Jan 04, 2005 at 10:20:55AM -0600, Bruce Dubbs wrote:
> In basic research on program readability, indentation of 2-4 characters 
> has been found to be optimal.  Eight space indenting was evaluated to be 
> as bad as no indenting at all.
 
So :set ts=4 or :set ts=2 it is then.  ;-)

> Sometimes a conscientious programmer puts some effort into making their 
> code readable.  Changing the tabstops can ruin that when a tab inserts 
> the equivalent of (say) 6 spaces for a 8 character tabstop.  (Or 2 
> spaces for a 4 character tabstop).

But the only time it matters that I've seen is with multiline comments
that start at the end of a line (so the programmer needs to align
subsequent comment line-starts with the start of the first comment).
And in that case, you (presumably) use the same tabstops as your
students, so you see the same thing anyway.  So why does it matter?

> For that reason, I instruct my students to use the entries in .vimrc
> above and it eliminates the problem.

Not really -- the problem is already gone when you use the same ts
setting as your students.  Having them use spaces doesn't buy you
anything.


In the case of the bootscripts, if we build vim with modeline support,
then we *could* insert modelines to automatically set tabstop in vim
when editing the files, and again, the problem with non-alignment is
solved.  (The modeline would be a shell comment somewhere in the file
consisting of "vim:ts=2" or whatever.)

It seems to me that your argument for spaces hinges on wanting everyone
else to see the exact same thing as what you see when they open the
file.

The people that want tabs want everyone else to see whatever they want
-- they don't want to force them to look at the scripts with a certain
indent level.  (Unless there are multiline comments that start at the
end of a non-comment line -- then there's no choice, you have to make
everyone else see what you see.)

The entire holy war over tabs vs. spaces generally boils down to that
difference -- do you want to force your preferences on the world, or do
you want to allow the rest of the world to set their tabs however they
like them?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20050104/6ab4a6aa/attachment.sig>


More information about the lfs-dev mailing list