Ken Moffat wrote:
> On Sun, Dec 11, 2011 at 12:23:26PM -0600, Bruce Dubbs wrote:
>> Ken Moffat wrote:
>>
>>> I know it tends to replace tabs with spaces, which makes it a bit of
>>> a pain when fixing up patches by hand, but basic copy and paste work.
>> There should never be tabs in patches. People use different
>> interpretations of a tab. Even tabs in Makefiles suck, even though they
>> are required.
>
> Lol. Ever seen the complaints about whitespace-damaged patches on
> lkml ? And, as you say, Makefiles require them.
The reason that they're damaged is that some use them and others don't.
I know that there are a lot of different opinions, but those who are
in favor of tabs don't read a lot of code. Tabs can't be inserted
automatically if a programmer is trying to write really readable code.
For example, if you write:
if ( a == b &&
c != d &&
d == f ){}
You can quite easily see the structure. If tabs are used and another
person uses 4 spaces for a tab instead of 3, this comes out as:
if ( a == b &&
c != d &&
d == f ){}
And the readability suffers.
Even in BLFS we try to line things up:
./configure --prefix=/usr \
--sysconfdir=/etc/ssh \
--datadir=/usr/share/sshd \
--libexecdir=/usr/lib/openssh \
--with-md5-passwords \
--with-privsep-path=/var/lib/sshd
If there were tabs, we'd lose the alignment depending on the tab
setting. The computer doesn't care, but people use the format to
interpret code and I like to make things easy for them.
One problem is that vim uses tabs by default. One of the first things I
do on a new system is set vimrc:
set nocompatible
set backspace=2
syntax on
set expandtab
set tabstop=3
set shiftwidth=3
set laststatus=2
set background=dark
set ai
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler
set hlsearch
------
The one we use in LFS is minimal and not really very useful other than
to show where the configuration file is located.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page