On Feb 9, 2007, at 11:06, Kevin Ballard wrote:
On Feb 9, 2007, at 12:01 PM, Ryan Schmidt wrote:
Is there any reason why we shouldn't
- have tabs at the beginnings of lines to provide indentation - use spaces within a line when we want to do something like align columns
That would seem the most logical solution to me.
Because different editors use different widths for tabs. And people who use editors that don't visually show tabs may not realize that it's tabs and not spaces (I assume that's why there are plenty of lines that start with a few tabs and then have 4 spaces after that).
I assume that's due to the stupid setting available in emacs or vi or whatever editor it is that actually encourages that behavior. The one where they've said "We want to indent to 4-space tabs. However, the editor is configured to print 8 spaces for a tab. Therefore, when we want to indent one level, we will use 4 spaces, and when we want to indent 2 levels, we will use one tab, and when we want to indent three levels, we will use one tab and then 4 spaces." And so forth. I'm convinced such an editor setting exists somewhere, because I have seen this nonsense in other projects too, even to the extreme of 2- space indentation. (Indent sequence: 2 spaces, 4 spaces, 6 spaces, one tab, one tab and 2 spaces, etc.)
Using only spaces seems not so good to me, because
- spaces uses 2 or 4 times as much disk space as a tab
Do you honestly believe this is a problem? I'm sure I can spare the few extra kB it might take.
No, not really a problem. I would accept extra disk space if this solution brought significant advantages, but I'm saying it brings drawbacks.
- spaces need 2 or 4 times as many presses on the delete key as a tab to remove in my editor
Then you need a better editor. Any modern editor should know how soft tabs work and allow you to delete them just like tabs. What editor are you using?
I use TextWrangler, the free sibbling of BBEdit. Also, if I press the Tab key on the keyboard, it inserts a tab character. Even if I could tell the editor to insert spaces instead, I would not configure my editor this way, because that is not how I want to use my editor in every other text file that I edit. Now I'm curious: What editor do other people use to edit their portfiles?
- I can't use my editor's tab width setting to see the amount of indentation I want to see
Is this ever actually a problem? lines should not be indented so much that 4-width soft tabs cause it to go off the end of the line. And besides, given the current state of indentation (mixture of tabs and spaces), this isn't viable with current source.
I'm just saying that you may like 2-space tabs, but I don't. If that's what we standardize on, I'll be unhappy. Someone else may like 3-space tabs, and they'll be unhappy unless we choose that. Why choose at all? Why not let the user choose with their editor's tab width setting? That's what it's for.