From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <blocke@shivan.org> X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DMARC_NONE,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=unavailable autolearn_force=no version=4.0.0 Received: from tesla.newpaltz.edu (tesla.newpaltz.edu [137.140.1.102]) by chiba.3jane.net (Postfix) with ESMTP id DA084ABBC9 for <gentoo-dev@gentoo.org>; Sun, 28 Apr 2002 00:01:14 -0500 (CDT) Received: from res62-189.resnet.newpaltz.edu (res62-189.resnet.newpaltz.edu [137.140.62.189]) by tesla.newpaltz.edu (8.9.3/8.9.3) with ESMTP id BAA10315 for <gentoo-dev@gentoo.org>; Sun, 28 Apr 2002 01:01:13 -0400 (EDT) Subject: Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) From: "Bruce A. Locke" <blocke@shivan.org> To: gentoo-dev@gentoo.org In-Reply-To: <uo4rhwwl0c.fsf@bashful.cdf.toronto.edu> References: <87elh07pmy.fsf@tea.thpoon.com> <1019957777.6580.6.camel@kodiak.chronospace.org> <uo4rhwwl0c.fsf@bashful.cdf.toronto.edu> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 Date: 28 Apr 2002 01:05:00 -0400 Message-Id: <1019970300.6580.39.camel@kodiak.chronospace.org> Mime-Version: 1.0 Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk Reply-To: gentoo-dev@gentoo.org List-Help: <mailto:gentoo-dev-request@gentoo.org?subject=help> List-Post: <mailto:gentoo-dev@gentoo.org> List-Subscribe: <http://lists.gentoo.org/mailman/listinfo/gentoo-dev>, <mailto:gentoo-dev-request@gentoo.org?subject=subscribe> List-Id: Gentoo Linux developer list <gentoo-dev.gentoo.org> List-Unsubscribe: <http://lists.gentoo.org/mailman/listinfo/gentoo-dev>, <mailto:gentoo-dev-request@gentoo.org?subject=unsubscribe> List-Archive: <http://lists.gentoo.org/pipermail/gentoo-dev/> X-Archives-Salt: 91c555f0-158b-4f54-9f2a-25285c3ef069 X-Archives-Hash: 825c8062f14fcbf5a8d811617d10c46d On Sat, 2002-04-27 at 23:38, Arcady Genkin wrote: > > Also which would you prefer to do: hit space a few times to make sure > > your new line is lined up with the old ones, or hit > > tab once and be done with it. > > Just as easily any decent editor can be configured to not use tab > characters, and insert 4 spaces when you hit TAB once (or to translate > all tab chars into spaces when saving the file). Then you just forced the issue. If you put 4 spaces in, there is no way to tell my editor to display it as a certain amount of whitespace, with tabs you can. Also your assuming everyone uses the same amount of spaces for everything. They do not... Some people use 4, some use 2, some use a random number and I encounter all of them in various ebuilds. If people use tabs the matter becomes much simpilier. Now that this topic has come up I must say I'm frankly tired of playing the <space><space><space><space><backspace> *hmm... is it lined up* game instead of <tab> *done* with alot of ebuilds. I admit to converting any ebuild I have to heavily modify to tabs out of habit without sometimes realizing it. > The advantage of > using spaces is that it also works well in *any* editor with *default* If they are using a GUI editor, your assuming they are using a monospaced font. If they are not using a monospaced font and using spaces it will look worse then if you used tabs in alot of cases. Also there are alot of bad editors out there... I'm sorry but I don't feel much sympathy for people using notepad, kedit, and many gui editors ;) > configuration, works with the pagers like "less" or "more", and even > with "cat". Could you explain what the problem is here? I view ebuilds with tabs in them all the time with no problems. I can't imagine a case where if there was an issue it would be important... do you edit your ebuilds with cat? :) > Of course, you can, possibly, configure your terminal > emulator to interpret TAB character as 4 spaces, but that's already > not trivial to do. Yes, you can do it, its an option at least. Spaces don't give you that option. > I find that I often use emacs and vi interchangeably, depending on the > task at hand. Furthermore, sometimes I use them from my usual > (non-privileged) account, and sometimes---as root. On top of this, I > do it on more than one machines, that don't share home directories. > If the indentation were all-spaces, I could just fire up any editor, > without thinking twice what machine I'm logged in to, and see the > ebuild exactly the way it was intended to be seen, as well as be able > to edit it likewise. This all goes to hell if using tabs, unless I > pre-configure my VI, emacsen and terminals for every possible > combination of machines and accounts. I don't know about you, but I'm quite happy with the default tab sizes in vim and emacs... and if for some reason I need to adjust it, its a single command in vim: set tabstop=4 This really shines working with real programming languages like C++, Python, and Java. Code can get nasty fast and the ability to be able to set "tabstop=1" at will can make the difference between having half of it off screen to making it somewhat readable :) And when I'm done reading that section I can set it back to 4 or whatever I'm comfortable with. > > I used to be anti-tab myself... Then overtime as I started using decent > > editors (vim, emacs, etc) I realized how much of a pain space indenting > > was and went back and have converted all my old ebuilds to using tabs. > > Interesting, why was it a pain with good editors? I have switched to > using all spaces years ago, when I saw what a piece of my tabbed code > looked like in somebody else's terminal, and never looked back. Nah, I was anti-tab because tab handling in bad editors sucked. On my list of bad editors includes pico, nano and joe. Once I moved to vim and started playing around with python, I realized the value of the tabs. The following may sound harsh. I had many different people say it to me and I thought it was harsh at the time but over the years I've learned... learn your editor. Its a vital tool. Quite frankly I'm not in the mood most of the time to dumb down what I do and spend a crapload of extra keystrokes to make someone who doesn't know their editor happier. The "someone else" in the above example had a crappy editor and didn't know his tools. In our case, ebuild development is not something for people who can't figure out tabs or spend 5 seconds using google :P The use of spaces forces presentation. Just because you happen to like spaces, I am now forced to deal with your idea of whitespace in a document. The use of tabs allows for the seperation of presentation and the actual data... I, the person reading it, can tell my editor a tab is 4 spaces or 2 spaces or 8. Two different people seeing the same file can see it in different ways but if they both use tabs then it won't matter because it will be the same file. I do think this matter is a very minor one and this email thread blows it out of proportion. I really don't care as much as this email probably sounds like I care, when I discuss things I tend to get forceful :). Its an age old flamewar and I doubt any minds will change... :) -- Bruce A. Locke blocke@shivan.org