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

Re: Tabs v.s. spaces



On Tue, Nov 18, 2003 at 09:43:40AM +0800, Isaac To wrote:
[snip]
>     H> That's because the terminal settings are b0rked. I personally delete
>     H> all programs that cannot cut-n-paste without messing up tabs and
>     H> spaces.  Unfortunately, this happens a lot on the Winbloxe desktop at
>     H> work.
> 
> Which terminal do you use that do not convert all the tabs into spaces?
> Personally I won't cut-and-paste from the terminal when programming.

Hmm, you're right. I just tested it from xterm, and it doesn't work quite
the way I thought it did. I'm pretty sure xterm used to let you copy tabs
properly, but that might be a very old version way back when. (Or perhaps
just my imagination.)

>     H> For personal pet projects, I use 2 spaces per nesting level. Some
>     H> people think that's Pure Evil(tm), although I fully agree with you
>     H> about wasting screen real estate in 80 columns (yes, I am one of
>     H> those freaks who insist that all code must not have lines longer than
>     H> 79 characters).
> 
> I believe Linus has a point here... 8 spaces per indentation level keeps you
> honest, since you can't put a whole crowd of things into a single function.

Well, that's a whole 'nother can of worms. I firmly believe that all
functions longer than one printed page (approx 48 lines or so) are
inherently broken and must be re-written. Nevertheless, I find 8-space
indentation too wasteful, 4-space indentation too cumbersome to type, and
1-space indentation unreadable. So I stick with 2. But I'm OK with 4 if it
helps others read the code.

> On the evil side, I had seen people who insist on using 1 space per
> indentation level.
[snip]

Yes, that's Pure Evil(tm). Just one step away from the atrocious
inconsistent indentation. (Believe me, I've seen *professional*
programmers insert random amounts of space just so they satisfy the law of
indentation, but it's completely inconsistent across blocks. Very annoying
to read.)


T

-- 
"I'm not childish; I'm just in touch with the child within!"



Reply to: