* [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
@ 2002-04-27 22:17 Arcady Genkin
2002-04-27 22:40 ` William McArthur
2002-04-28 1:36 ` Bruce A. Locke
0 siblings, 2 replies; 13+ messages in thread
From: Arcady Genkin @ 2002-04-27 22:17 UTC (permalink / raw
To: gentoo-dev
Two questions:
1. What makes tabbed indentation in ebuilds so much better than
indentation with spaces? I know *plenty* of reasons *against* using
tab characters, but I must be missing something obvious, because I
know no reasons in favor of tabs.
2. Even if it turns out tabs are somehow better than spaces, why do
we want to be so fascist[1][2] about it? Why don't we let the ebuild
maintainer to decide which approach suits his philosophy, editor and
habits? We can still require that all indents are 4 spaces wide; I'm
only talking about tabs/spaces issue.
Footnotes:
[1] Talking about bulk force-tabbifying ebuilds.
[2] Please note the smiley in the subject line before you stone me
for my choice of words.
--
Arcady Genkin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-27 22:17 [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) Arcady Genkin
@ 2002-04-27 22:40 ` William McArthur
2002-04-28 1:36 ` Bruce A. Locke
1 sibling, 0 replies; 13+ messages in thread
From: William McArthur @ 2002-04-27 22:40 UTC (permalink / raw
To: gentoo-dev
Arcady Genkin wrote:
> Two questions:
>
> 1. What makes tabbed indentation in ebuilds so much better than
> indentation with spaces? I know *plenty* of reasons *against* using
> tab characters, but I must be missing something obvious, because I
> know no reasons in favor of tabs.
I have no preference of one over the other but I prefer one over both.
> 2. Even if it turns out tabs are somehow better than spaces, why do
> we want to be so fascist[1][2] about it? Why don't we let the ebuild
> maintainer to decide which approach suits his philosophy, editor and
> habits? We can still require that all indents are 4 spaces wide; I'm
> only talking about tabs/spaces issue.
Because any large project must maintain a level of consistencey. While
tab vs spaces is a minor issue it is part of a larger whole and as such
is important. My mother used to pound in to me: "Mind your pennies and
your dollars will take care of themselves." I don't know who she was
quoting but the same logic applies here.
Where there isn't any place I know of the specificly spells out the
tab/space usage in an ebuild if you look at /usr/portage/skel.ebuild you
will see that tabs are uses.
> Footnotes:
> [1] Talking about bulk force-tabbifying ebuilds.
> [2] Please note the smiley in the subject line before you stone me
> for my choice of words.
Sandy McArthur
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-27 22:17 [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) Arcady Genkin
2002-04-27 22:40 ` William McArthur
@ 2002-04-28 1:36 ` Bruce A. Locke
2002-04-28 3:38 ` Arcady Genkin
1 sibling, 1 reply; 13+ messages in thread
From: Bruce A. Locke @ 2002-04-28 1:36 UTC (permalink / raw
To: gentoo-dev
On Sat, 2002-04-27 at 18:17, Arcady Genkin wrote:
> Two questions:
>
> 1. What makes tabbed indentation in ebuilds so much better than
> indentation with spaces? I know *plenty* of reasons *against* using
> tab characters, but I must be missing something obvious, because I
> know no reasons in favor of tabs.
In any decent editor you can set the number of spaces a tab corresponds
to on the screen. If tabs in your editor are creating too much
whitespace for your taste on your screen, its configurable. And because
you used tabs, anyone can tell their editor how many spaces to display
and if they use tabs then its all left up to how the editor displays it.
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.
>
> 2. Even if it turns out tabs are somehow better than spaces, why do
> we want to be so fascist[1][2] about it? Why don't we let the ebuild
> maintainer to decide which approach suits his philosophy, editor and
> habits? We can still require that all indents are 4 spaces wide; I'm
> only talking about tabs/spaces issue.
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.
And while we are joking around, whats more fascist... forcing me to deal
with "hardcode" spaces forcing me to have my terminal X columns wide, or
leaving it to the enduser to configure their editor to display it with
the number of spaces they like ;)
--
Bruce A. Locke
blocke@shivan.org
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 1:36 ` Bruce A. Locke
@ 2002-04-28 3:38 ` Arcady Genkin
2002-04-28 5:05 ` Bruce A. Locke
2002-04-28 12:00 ` Alexander Gretencord
0 siblings, 2 replies; 13+ messages in thread
From: Arcady Genkin @ 2002-04-28 3:38 UTC (permalink / raw
To: gentoo-dev
"Bruce A. Locke" <blocke@shivan.org> writes:
> In any decent editor you can set the number of spaces a tab corresponds
> to on the screen. If tabs in your editor are creating too much
> whitespace for your taste on your screen, its configurable. And because
> you used tabs, anyone can tell their editor how many spaces to display
> and if they use tabs then its all left up to how the editor displays it.
>
> 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). The advantage of
using spaces is that it also works well in *any* editor with *default*
configuration, works with the pagers like "less" or "more", and even
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.
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 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.
> whats more fascist... forcing me to deal with "hardcode" spaces
> forcing me to have my terminal X columns wide, or leaving it to the
> enduser to configure their editor to display it with the number of
> spaces they like ;)
Okay, you are not really serious, right? It's quite reasonable to
assume that your terminal is at least 80 columns wide. Besides, the
adjustment you mention won't really work all of the time.
--
Arcady Genkin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 3:38 ` Arcady Genkin
@ 2002-04-28 5:05 ` Bruce A. Locke
2002-04-28 5:31 ` William McArthur
2002-04-28 12:00 ` Alexander Gretencord
1 sibling, 1 reply; 13+ messages in thread
From: Bruce A. Locke @ 2002-04-28 5:05 UTC (permalink / raw
To: gentoo-dev
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 5:05 ` Bruce A. Locke
@ 2002-04-28 5:31 ` William McArthur
2002-04-28 6:53 ` Arcady Genkin
2002-04-29 12:08 ` Spider
0 siblings, 2 replies; 13+ messages in thread
From: William McArthur @ 2002-04-28 5:31 UTC (permalink / raw
To: gentoo-dev
Bruce A. Locke wrote:
> Its an age old flamewar and I doubt any minds will change... :)
Only time and experience can change a mind on this topic. It's
intersting to watch how as a programer matures so do his coding habbits.
Sandy McArthur
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 5:31 ` William McArthur
@ 2002-04-28 6:53 ` Arcady Genkin
2002-04-29 12:08 ` Spider
1 sibling, 0 replies; 13+ messages in thread
From: Arcady Genkin @ 2002-04-28 6:53 UTC (permalink / raw
To: gentoo-dev
William McArthur <sandymac@gentoo.org> writes:
>> Its an age old flamewar and I doubt any minds will change... :)
>
> Only time and experience can change a mind on this topic. It's
> intersting to watch how as a programer matures so do his coding
> habbits.
The interesting part is that the same road may lead to either
preference. ;^) I prepared a full-blown reply for Bruce's last
message, but I guess that I'd rather save everybody's time by
refraining from posting it, since the majority of Gentoo devs are
obviously in favour of the tab character.
I don't mind complying with the coding style. I was simply trying to
probe whether anyone shared my dislike for tabs and whether there was
a chance for me to keep my ebuilds the way I like it.
--
Arcady Genkin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 3:38 ` Arcady Genkin
2002-04-28 5:05 ` Bruce A. Locke
@ 2002-04-28 12:00 ` Alexander Gretencord
1 sibling, 0 replies; 13+ messages in thread
From: Alexander Gretencord @ 2002-04-28 12:00 UTC (permalink / raw
To: gentoo-dev
On Sunday 28 April 2002 05:38, Arcady Genkin wrote:
> Just as easily any decent editor can be configured to not use tab
> characters, and insert 4 spaces when you hit TAB once.
Sure you can (with any decent editor) but it doesn't make the real problem go
away.
> unless I pre-configure my VI, emacsen and terminals for every possible
> combination of machines and accounts.
Well it's not our problem that your homedirectories don't contain your editor
startup files. Besides that, the ebuilds will look just fine without you
setting anything. The tabstop=4 (or whatever) thing comes into play with real
source code where you have plenty of indentation where you want to see all of
the code without making your terminal bigger (if you can). With tabs you can
do this as Bruce pointed out already with spaces you're doomed.
Alex
--
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
Benjamin Franklin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-28 5:31 ` William McArthur
2002-04-28 6:53 ` Arcady Genkin
@ 2002-04-29 12:08 ` Spider
2002-04-29 12:26 ` William McArthur
1 sibling, 1 reply; 13+ messages in thread
From: Spider @ 2002-04-29 12:08 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]
sandymac@gentoo.org>
> Only time and experience can change a mind on this topic. It's
> intersting to watch how as a programer matures so do his coding
> habbits.
Hmm, theres an interesting issue here though. How many coders here
learned to code during the hardcore pascal era? the "you use two spaces
indentation" was slowly and forcibly poured down my throat and into my
spine, I still do it everyime I'm in a decent pascal / delphi editor.
(so far no IDE has been equal to borland tp-7 or above, definitely not
their sk. c/c++ IDE's, but that's a different flame ;)
Now, when I started c/c++ coding (and later, java) it was <tab> all the
way... but, pascal? no... its doublespace you darn morons! it has to be!
force! foooorce! and make a sed-script if it isn't :)
now, Does anyone know how to make gpm transfer tabs/spaces ok instead of
converting all my tabs to spaces? or failing gpm working, getting vim to
notice gpm broken paste and convert and align nicely?
//Spider
--
begin .signature
This is a .signature virus! Please copy me into your .signature!
See Microsoft KB Article Q265230 for more information.
end
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-29 12:08 ` Spider
@ 2002-04-29 12:26 ` William McArthur
2002-04-29 17:00 ` Joachim Blaabjerg
0 siblings, 1 reply; 13+ messages in thread
From: William McArthur @ 2002-04-29 12:26 UTC (permalink / raw
To: gentoo-dev
Spider wrote:
> now, Does anyone know how to make gpm transfer tabs/spaces ok instead of
> converting all my tabs to spaces? or failing gpm working, getting vim to
> notice gpm broken paste and convert and align nicely?
Not gonna happen, gpm doesn't read what the program output to the
screen. It reads the rendered form of what the program output. Sorta
like if you were to cat the contents of /dev/vcc/# (assuming devfs) and
just pick out a section of characters.
Sandy McArthur
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-29 17:00 ` Joachim Blaabjerg
@ 2002-04-29 15:36 ` Jon Nelson
2002-04-29 15:39 ` Vitaly Kushneriuk
1 sibling, 0 replies; 13+ messages in thread
From: Jon Nelson @ 2002-04-29 15:36 UTC (permalink / raw
To: gentoo-dev; +Cc: styx
On Mon, 29 Apr 2002 17:00:39 +0000
Joachim Blaabjerg <styx@SuxOS.org> wrote:
>
> Spider wrote:
> > now, Does anyone know how to make gpm transfer tabs/spaces ok
> > instead of converting all my tabs to spaces? or failing gpm
> > working, getting vim to notice gpm broken paste and convert
> > and align nicely?
>
> I don't know how that would be done, and I agree with mr.
> McArthur that it is unlikely to happen. However, you could
> always use an sed ugly hack once in a while to convert tabs to
> spaces.
>
> sed s/"\t"/\ \ \ \ /g source-tabs.c > source-spaces.c
>
> It works here, but I realise it's _far_ from a solution (and
> ugly as hell). Just replace the number of escaped spaces to
> suit your needs.
Uh, you could always just use 'unexpand' (spaces->tabs) or
'expand' (tabs->spaces).
--
Jon Nelson
C and Python Programmer, Code Gardener
Just because it's not broken doesn't mean we can't take it apart.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-29 17:00 ` Joachim Blaabjerg
2002-04-29 15:36 ` Jon Nelson
@ 2002-04-29 15:39 ` Vitaly Kushneriuk
1 sibling, 0 replies; 13+ messages in thread
From: Vitaly Kushneriuk @ 2002-04-29 15:39 UTC (permalink / raw
To: gentoo-dev
On Mon, 2002-04-29 at 20:00, Joachim Blaabjerg wrote:
>
> Spider wrote:
> > now, Does anyone know how to make gpm transfer tabs/spaces ok instead of
> > converting all my tabs to spaces? or failing gpm working, getting vim to
> > notice gpm broken paste and convert and align nicely?
>
> I don't know how that would be done, and I agree with mr. McArthur that it is
> unlikely to happen. However, you could always use an sed ugly hack once in a
> while to convert tabs to spaces.
>
> sed s/"\t"/\ \ \ \ /g source-tabs.c > source-spaces.c
>
> It works here, but I realise it's _far_ from a solution (and ugly as hell).
> Just replace the number of escaped spaces to suit your needs.
This will be _very_ ugly for tabs that are not at the beginning of the
line. i.e. when tab should expand to a _less_ then 8/4 spaces, as it
starts not at a tabstop position.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^)
2002-04-29 12:26 ` William McArthur
@ 2002-04-29 17:00 ` Joachim Blaabjerg
2002-04-29 15:36 ` Jon Nelson
2002-04-29 15:39 ` Vitaly Kushneriuk
0 siblings, 2 replies; 13+ messages in thread
From: Joachim Blaabjerg @ 2002-04-29 17:00 UTC (permalink / raw
To: gentoo-dev
Spider wrote:
> now, Does anyone know how to make gpm transfer tabs/spaces ok instead of
> converting all my tabs to spaces? or failing gpm working, getting vim to
> notice gpm broken paste and convert and align nicely?
I don't know how that would be done, and I agree with mr. McArthur that it is
unlikely to happen. However, you could always use an sed ugly hack once in a
while to convert tabs to spaces.
sed s/"\t"/\ \ \ \ /g source-tabs.c > source-spaces.c
It works here, but I realise it's _far_ from a solution (and ugly as hell).
Just replace the number of escaped spaces to suit your needs.
Regards,
--
Joachim Blaabjerg
styx@SuxOS.org
www.SuxOS.org
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2002-04-29 15:35 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-27 22:17 [gentoo-dev] Ebuild indentation (tabs vs. spaces) fascism ;^) Arcady Genkin
2002-04-27 22:40 ` William McArthur
2002-04-28 1:36 ` Bruce A. Locke
2002-04-28 3:38 ` Arcady Genkin
2002-04-28 5:05 ` Bruce A. Locke
2002-04-28 5:31 ` William McArthur
2002-04-28 6:53 ` Arcady Genkin
2002-04-29 12:08 ` Spider
2002-04-29 12:26 ` William McArthur
2002-04-29 17:00 ` Joachim Blaabjerg
2002-04-29 15:36 ` Jon Nelson
2002-04-29 15:39 ` Vitaly Kushneriuk
2002-04-28 12:00 ` Alexander Gretencord
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox