On Thu, May 21, 2015 at 08:49:33PM -0500, Bruce Dubbs wrote:
> Ken Moffat wrote:
> 
> >Bruce, I can see that you use tiny tab spacing in your own code, but
> >what is your objection to tabs in a patch ?  If upstream uses tabs,
> >then tabs are the right thing for the patch.  For a sed, spacing and
> >alignment are optional.
> 
> My objection to embedded taps is that different users have different
> settings for tab stops.  The files look a lot different if viewed in an
> editor and in a cat.  If spaces are used, then the file looks identical for
> everyone no matter what tools are used.
> 

The content of a patch (i.e. the actual diff) ought to match the
standards of the project to which it is being applied - i.e the
upstream, not our own individual preferences.

The kernel uses tabs.  Other projects will no-doubt have their own
standards, but tabs seem to be very common.  I can notice this in
'view' because the "excess whitespace" of a context line (a space in
front of a tab) gets highlighted for me.

As to what is in the description, I do not see any particular reason
to care if it uses tabs or spaces.  So, if I cherry-pick a commit, I
will probably paste the description from the original commit after
re-diffing.

> At one time, the difference in spaces and tabs made a difference in file
> size. Today, a few dozen bytes in the file size is quite negligible.
> 
> As far as small tab sizes go (indentation), there has been quite a bit of
> research (admittedly old now), that says that the readability of source code
> is optimal at 2-4 spaces for indentation.  I split the difference and use 3.
> 
"Then shalt thou count to three, no more, no less.
 Three shall be the number thou shalt count,
 and the number of the counting shall be three."
;-)

For C-style code, 8 helps show the structure of a long function much
better IMHO.

For bash, which is what I write these days, I find 8 easier to
follow - but I do drop to 4 if I need to nest 'if' statements, and
sometimes I will indent two spaces for a continuation.

> Also, for indentation of fixed pitch fonts (for example 12 point monospaced)
> is about 6 points or .083 inch.  Indentation of 8 characters then is about
> 2/3 inch.  In a printed text, how often do you see that much indention in
> printed (paper) documents?  Rarely because 1) it wastes space, and 2)
> because it actually makes comprehension slower.
> 

For a printed text, all the considerations are different, and small
indentation often makes a lot of sense.  You might even use a
proportional font if printing, depending on the content.

ĸen
-- 
Nanny Ogg usually went to bed early. After all, she was an old lady.
Sometimes she went to bed as early as 6 a.m.
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to