in reply to Re: (jeffa) 2Re: Losing or overwritting values
in thread Losing or overwritting values

Like you said ... this is all opinion, the important thing is consistency. (And if you don't use vi ... )

However, i will continue to fight for tabs over spaces when indenting on the left side. The right side was made for spaces, but using spaces on the left side is just too much typing for me. "Let's see, do i hit the tab 3 times or the space bar 12 times?" I am sorry, but using spaces on the left side is simply having to do more work than i really need to do. I started out using spaces, switched to tabs, and i have been using tabs ever since. Besides:
# need to convert 4 spaces to a tab? perl -pe 's/ /\t/g' foo.pl # need to convert a tab to 4 spaces? perl -pe 's/\t/ /g' foo.pl
These could be made more robust, but i think the point has been made. As long as we can easily convert from one to the other, we shouldn't worry about whether or not we use tabs or spaces, as long as we are consistent. But me? I use tabs. I am just too lazy not to.

"The reason I advocate spaces is that they are inherently consistent and do not rely on an editor or terminal variable as tabs do."

And this is exactly the same reason why i advocate tabs. If i am on a smaller screen, i can set my tabstop in vi to 3. If i am on a larger screen, i can set the tabstop to 6. It is more flexible. Thanks to expand, i can deliver my code with tabs converted to any number of spaces. Let the computer do the work.

P.S. (FWIW), this is a heated argument at the Computer Science department at my University. The camps have picked sides and the line has been drawn. Some professors teach their students to use tabs, others spaces. Neither side has convinced the other that they are right, and i doubt they ever will. Now, let's get back to Perl! ;)

UPDATE:

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Tabs are from Venus, Spaces are from Mars
by sauoq (Abbot) on Jan 06, 2003 at 00:04 UTC
    The right side was made for spaces, but using spaces on the left side is just too much typing for me. "Let's see, do i hit the tab 3 times or the space bar 12 times?" I am sorry, but using spaces on the left side is simply having to do more work than i really need to do.

    I've found that that's the normal argument for tab-using heathens¹ such as yourself. Really, it probably means you just haven't fully learned the capabilities of your editor. Even with the (admittedly broken) stock vi on Solaris, you can set ai, set ts=80, set sw=4 (or whatever) and get by just fine without wearing out your spacebar. Vim and other vi clones have added the softtabstop and expandtab options. It's easy with emacs, of course. It's doable with almost every half-featured programmer's editor available for any platform...

    1. I know this is a holy war here. The "heathen" comment is meant in good humor, of course.

    -sauoq
    "My two cents aren't worth a dime.";
    
      Except it remains easier to backspace away tabs than spaces.

      Makeshifts last the longest.

        Using vi, "<<" works nicely to shift the line to the left by one shiftwidth (and it doesn't even matter where you are on the line.) I'm pretty sure emacs has the same functionality but, as I don't use emacs, I don't know how to achieve it offhand. I'm less sure of other programmer's editors on this point though I suspect that its a common feature.

        -sauoq
        "My two cents aren't worth a dime.";