Gentoo Archives: gentoo-dev

From: "Bruce A. Locke" <blocke@××××××.org>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
Date: Sun, 28 Apr 2002 00:01:14
Message-Id: 1019970300.6580.39.camel@kodiak.chronospace.org
In Reply to: Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) by Arcady Genkin
1 On Sat, 2002-04-27 at 23:38, Arcady Genkin wrote:
2 > > Also which would you prefer to do: hit space a few times to make sure
3 > > your new line is lined up with the old ones, or hit
4 > > tab once and be done with it.
5 >
6 > Just as easily any decent editor can be configured to not use tab
7 > characters, and insert 4 spaces when you hit TAB once (or to translate
8 > all tab chars into spaces when saving the file).
9
10 Then you just forced the issue. If you put 4 spaces in, there is no way
11 to tell my editor to display it as a certain amount of whitespace, with
12 tabs you can.
13
14 Also your assuming everyone uses the same amount of spaces for
15 everything. They do not... Some people use 4, some use 2, some use a
16 random number and I encounter all of them in various ebuilds. If people
17 use tabs the matter becomes much simpilier.
18
19 Now that this topic has come up I must say I'm frankly tired of playing
20 the <space><space><space><space><backspace> *hmm... is it lined up* game
21 instead of <tab> *done* with alot of ebuilds. I admit to converting any
22 ebuild I have to heavily modify to tabs out of habit without sometimes
23 realizing it.
24
25 > The advantage of
26 > using spaces is that it also works well in *any* editor with *default*
27
28 If they are using a GUI editor, your assuming they are using a
29 monospaced font. If they are not using a monospaced font and using
30 spaces it will look worse then if you used tabs in alot of cases.
31
32 Also there are alot of bad editors out there... I'm sorry but I don't
33 feel much sympathy for people using notepad, kedit, and many gui editors
34 ;)
35
36 > configuration, works with the pagers like "less" or "more", and even
37 > with "cat".
38
39 Could you explain what the problem is here? I view ebuilds with tabs in
40 them all the time with no problems. I can't imagine a case where if
41 there was an issue it would be important... do you edit your ebuilds
42 with cat? :)
43
44 > Of course, you can, possibly, configure your terminal
45 > emulator to interpret TAB character as 4 spaces, but that's already
46 > not trivial to do.
47
48 Yes, you can do it, its an option at least. Spaces don't give you that
49 option.
50
51 > I find that I often use emacs and vi interchangeably, depending on the
52 > task at hand. Furthermore, sometimes I use them from my usual
53 > (non-privileged) account, and sometimes---as root. On top of this, I
54 > do it on more than one machines, that don't share home directories.
55 > If the indentation were all-spaces, I could just fire up any editor,
56 > without thinking twice what machine I'm logged in to, and see the
57 > ebuild exactly the way it was intended to be seen, as well as be able
58 > to edit it likewise. This all goes to hell if using tabs, unless I
59 > pre-configure my VI, emacsen and terminals for every possible
60 > combination of machines and accounts.
61
62 I don't know about you, but I'm quite happy with the default tab sizes
63 in vim and emacs... and if for some reason I need to adjust it, its a
64 single command in vim:
65
66 set tabstop=4
67
68 This really shines working with real programming languages like C++,
69 Python, and Java. Code can get nasty fast and the ability to be able to
70 set "tabstop=1" at will can make the difference between having half of
71 it off screen to making it somewhat readable :) And when I'm done
72 reading that section I can set it back to 4 or whatever I'm comfortable
73 with.
74
75 > > I used to be anti-tab myself... Then overtime as I started using decent
76 > > editors (vim, emacs, etc) I realized how much of a pain space indenting
77 > > was and went back and have converted all my old ebuilds to using tabs.
78 >
79 > Interesting, why was it a pain with good editors? I have switched to
80 > using all spaces years ago, when I saw what a piece of my tabbed code
81 > looked like in somebody else's terminal, and never looked back.
82
83 Nah, I was anti-tab because tab handling in bad editors sucked. On my
84 list of bad editors includes pico, nano and joe. Once I moved to vim
85 and started playing around with python, I realized the value of the
86 tabs.
87
88 The following may sound harsh. I had many different people say it to me
89 and I thought it was harsh at the time but over the years I've
90 learned... learn your editor. Its a vital tool. Quite frankly I'm not
91 in the mood most of the time to dumb down what I do and spend a crapload
92 of extra keystrokes to make someone who doesn't know their editor
93 happier. The "someone else" in the above example had a crappy editor
94 and didn't know his tools. In our case, ebuild development is not
95 something for people who can't figure out tabs or spend 5 seconds using
96 google :P
97
98 The use of spaces forces presentation. Just because you happen to like
99 spaces, I am now forced to deal with your idea of whitespace in a
100 document. The use of tabs allows for the seperation of presentation and
101 the actual data... I, the person reading it, can tell my editor a tab is
102 4 spaces or 2 spaces or 8. Two different people seeing the same file
103 can see it in different ways but if they both use tabs then it won't
104 matter because it will be the same file.
105
106 I do think this matter is a very minor one and this email thread blows
107 it out of proportion. I really don't care as much as this email
108 probably sounds like I care, when I discuss things I tend to get
109 forceful :).
110
111 Its an age old flamewar and I doubt any minds will change... :)
112
113
114 --
115
116 Bruce A. Locke
117 blocke@××××××.org

Replies

Subject Author
Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) William McArthur <sandymac@g.o>