What hope hath man / who takes up arms / against h'brother / for space only?
March 18, 2006 2:30 PM   Subscribe


 
Context! Context context context!
posted by Aquaman at 2:35 PM on March 18, 2006


The perfect example of a FPP that I don't quite understand and will never read.
posted by mrmojoflying at 2:49 PM on March 18, 2006


...Cute though.
posted by mrmojoflying at 2:49 PM on March 18, 2006


OK then, the idea is that people will insist on having passionate, raving arguments over the silliest, most trivial things, suggesting the question: what is the point in arguing the big issues if we can't even agree on the little ones?

Other than that, yes, it's pretty inane, but I'm a sucker for geek minutiae. Next up: Frostbrand vs Grayswandir!
posted by hoverboards don't work on water at 2:54 PM on March 18, 2006


Tabs.

I like this post but wouldn't need to see a bunch of lookalikes any time soon.
posted by Wolfdog at 2:56 PM on March 18, 2006


Stormbringer, duh.
posted by gleuschk at 2:59 PM on March 18, 2006


Several of these links subsequently link to at least one of the links above, either in the article or in the comments.
posted by crysflame at 3:00 PM on March 18, 2006


wolfdog No? I was working on one about vim and emacs.
posted by TwelveTwo at 3:03 PM on March 18, 2006


When in my text editor, tabs. When in a textarea, spaces. Unless I'm in OS X Safari, in which Opt-Tab produces a tab.
posted by brownpau at 3:03 PM on March 18, 2006


i can't get tabs to work in the comment box, so it'll have to be spaces
posted by pyramid termite at 3:06 PM on March 18, 2006



posted by brownpau at 3:06 PM on March 18, 2006


Tabs, unless it's Wednesday.
posted by danb at 3:06 PM on March 18, 2006


Tabs, but displayed as 4 spaces-width. (Thank you IDEs).
posted by beerbajay at 3:06 PM on March 18, 2006


Can you set this FPP to a tune? Maybe combine it with the drumline FPP?
posted by lalochezia at 3:10 PM on March 18, 2006


Tabs.

Also, vi (not emacs), Linux (not BSD), stirred (not shaken).
posted by sveskemus at 3:10 PM on March 18, 2006


Visual studio does it all for me...
posted by Artw at 3:11 PM on March 18, 2006


gold.
posted by shoepal at 3:14 PM on March 18, 2006


I favour tabs, others spaces.
posted by juiceCake at 3:18 PM on March 18, 2006


Tabs. When it absolutely, positively has to line-up.
posted by Thorzdad at 3:25 PM on March 18, 2006


Also, vi (not emacs), Linux (not BSD), stirred (not shaken).

Ah, my old nemeses, we meet again.

emacs, bsd, shaken.

But i will agree with you on tabs.
posted by quin at 3:30 PM on March 18, 2006


Actually, twelvetwo, I'd kinda like to see that. vi.
posted by Wolfdog at 3:38 PM on March 18, 2006


Nnnnnnnnnneeeeeeeeeeerrrrrrrrrrrrrrrd.

Also tabs, width:2.

Being a MS droid, the only thing I found of use in Linux editing was emacs' auto-indent which does (very nearly) exactly what I would have. I don't know which methodology it uses, I don't care; it works well, it's predictable and it's useful. As a programmer, that's really all I want.

Arguments about creating emptiness and the representations thereof are best left to the philosophers. Not somone in a stained Amiga t-shirt.
posted by NinjaPirate at 3:38 PM on March 18, 2006


I prefer the new Energy Tabs!
posted by fenriq at 3:46 PM on March 18, 2006



Damn Tabs!
posted by ahughey at 3:50 PM on March 18, 2006


It's wonderful how the internet exposes you to other cultures. Like, apparently the worst problems facing England right now are kids climbing on painted surfaces and mailing rodents. I'd had no idea.
posted by nebulawindphone at 3:58 PM on March 18, 2006


Too jargony.
posted by Alvy Ampersand at 3:58 PM on March 18, 2006



posted by jfuller at 4:02 PM on March 18, 2006


> Also, vi (not emacs), Linux (not BSD), stirred (not shaken).

Some say the world will end in fire,
Some say in ice.
posted by jfuller at 4:02 PM on March 18, 2006


Zawinski has the correct analysis and solution. Nothing more really needs to be said. Anyone who thinks that an ASCII tab character has any business being in a source code file is an idiot.
posted by Crabby Appleton at 4:05 PM on March 18, 2006


Developers!Developers!Developers!Developers!Developers!

People need to relax, this is no jihad. Use the defaults for whatever editor you're using. I use spaces at work, I would prefer tabs, but I don't determine policy. Suck it, haters!
posted by blue_beetle at 4:06 PM on March 18, 2006


Definitely Grayswandir. Duh.
posted by aubilenon at 4:14 PM on March 18, 2006


I don't believe it! Tabs?!? Tabs?

Spaces! Four spaces per indentation level! Anything else - chaos!
posted by ny_scotsman at 4:23 PM on March 18, 2006


Also tabs, width:2.

Huh? Why would anyone care what you set your tab width to? The whole point of using tabs is so that you can set it to whatever you like, as I'm sure is explained many times over in the links up there.

:1,$s/^\([\t]*\) /\1\t/
posted by sfenders at 4:25 PM on March 18, 2006


I figured this post was in response to this one from earlier today.

I didn't bother trying to comment to the poor souls lost in their endless ideologically extreme arguments there. I hope for a time where people treat each other with respect, despite our obvious differences.

Until we reach that time, I'm just doing my best to see that everyone who uses emacs has all of their fingers amputated at the knuckle.
posted by tkolar at 4:40 PM on March 18, 2006


tkolar: You were the one who cut off my fingers in my sleep! Sick fucking bastard.
posted by grouse at 4:49 PM on March 18, 2006


You know, it's funny, i was always told that the only people who used VI were inbred pedophiles who suffered from fetal-alcohol syndrome and supported the Nazi party.

i'm sure that isn't true, and i'm hoping that some day i'll meet someone who uses VI that isn't a Nazi supporter.
posted by quin at 4:50 PM on March 18, 2006


vi or vim, BSD, Grayswandir, stirred, and:

Spaces that are interpreted by the editor as tabs.
posted by blasdelf at 4:50 PM on March 18, 2006


sfenders, the problem with tabs is that code that is laid out neatly with tabs set to 4 spaces gets messed up at three or eight spaces. If you use spaces it's always laid out the same way. Spaces, while arguably slightly more work to maintain, are the simple cost that lets people use whatever editor they choose.

We are just talking about code, right?
posted by ny_scotsman at 4:51 PM on March 18, 2006


tkolar: You were the one who cut off my fingers in my sleep! Sick fucking bastard.

True, it would reflect much better on my mental health if I only did it to people who were awake.
posted by tkolar at 4:58 PM on March 18, 2006


> You know, it's funny, i was always told that the only people who used VI were
> inbred pedophiles who suffered from fetal-alcohol syndrome and supported the Nazi party.

Suh! They has been no cousin-marryin' in mah famly fo' et least three gen'rations! esc wq

posted by jfuller at 5:02 PM on March 18, 2006


Personally I prefer Pico (on Linux) for most everyday editing tasks, and I've been using a flush-left margin for Usenet and email for a decade now. Since I seldom write anything else it ain't been much of a problem.

As for the other stuff: my preferred adult beverage is bourbon neat in a wide glass, I think video games are for teenaged virgins, and my favorite cousin STILL won't have me -- after 35 years I've pretty much given up on her.
posted by davy at 5:44 PM on March 18, 2006


Spaces! But my tab key inserts two spaces. I'm more intereste in where you put your brackets...

if (foo) {

} else {

}

or

if (foo)
{

}

or...

if (foo)
{

}

you get the point..
posted by SirOmega at 6:02 PM on March 18, 2006


Spaces. Because, over the last three decades, you tabs people have proven beyond the shadow of a doubt that you lack the discipline to use tabs consistently.

I don't want to hear any complaining now, you've brought this upon yourselves.
posted by Galvatron at 6:02 PM on March 18, 2006


Bah! Multiple spaces dont recognize.. even & nbsp; wont work
posted by SirOmega at 6:04 PM on March 18, 2006


Tabs. Tabs mean freedom of choice. Spaces mean forcing your will upon others. Unless you keep your code to yourself, which means you're a selfish bastard.
posted by zsazsa at 6:08 PM on March 18, 2006


And, yes, comment blocks to the right of code and alignment tricks sometimes break when using tabs with a width other than what the coder used, but both are dumb and are done by people who think they are being clever.
posted by zsazsa at 6:12 PM on March 18, 2006


Clearly I have a long way to go in the geek department because I've not yet started worrying about this particular issue.
posted by ddf at 6:16 PM on March 18, 2006


ny_scotsman writes "Spaces! Four spaces per indentation level! Anything else - chaos!"

Nod. This is perfection.
posted by purephase at 6:22 PM on March 18, 2006


Tabs.

:wq
posted by GuyZero at 6:26 PM on March 18, 2006


I agree with Sir Omega's comment, I'd rather be more concerned with the bracketing style.

Myself, I prefer the open style of:
if (foo)
{
    bar
}
rather then what I think is harder to read:
if (foo) {
    bar
}
and of course, my favorite pet peeve, cram it all in one line:
if (foo) {  bar  }

which is just silly.
posted by Vicarious at 6:40 PM on March 18, 2006


The chaos that ny_scotsman refers to with tabs is solved by the third camp in this originally linked page. However, I've not yet found an editor with decent support for such a hybrid mode.
posted by Mr Stickfigure at 6:42 PM on March 18, 2006


if( vertical ) {
  baz( y, x ) ;
} else {
  baz( x, y ) ;
}

Notice the spaces distinguish the function parameters and the if-expression, not the "if" keyword or the function names. Your eye has seen the keyword thousands of times, and the function name at least dozens of times. what makes this code different from other code is the parameters being passed and the if-expression. Make the differences, not the commonalties, stand out. "baz( x, y )" and "baz( y, x )" are probably doing very different things. That depends on the value of "vertical". Let those things stand out.
posted by orthogonality at 7:07 PM on March 18, 2006


Indentation is logical, not decorative; use tabs. Use spaces after the tabs if you really just want to line something up with something in the line above. But don't do that; if you've got more parameters than you want to fit on one line, treat the parameter list as a block:

if ( subname(
  first_arg, second_arg, third_arg,
  fourth_arg, fifth_arg, sixth_arg
) ) then {
  do_if_true( x, y );
}


As for punctuation, I prefer:

if ( condition ) {
  do_if_true( x, y );
} else {
  do_if_false( x, y );
}


Because if isn't a subroutine name, it's a flow-of-control operator, and this makes them easy to tell apart.
posted by nicwolff at 7:53 PM on March 18, 2006


Oh, and my pet peeve is whatever mode of (I assume) emacs it is that indents code with four spaces for one level, one tab for two levels, one tab and four spaces for three levels, two tabs for four levels, &c. Fucking annoying.
posted by nicwolff at 7:58 PM on March 18, 2006


re: tabs vs. spaces.

A simple three-step solution on this.

1: pick a standard for your organization/project. Either one will do.
2: give anyone who voices objections to the standards of your project a dirty-water swirlie.
3: Repeat step 2 as necessary to build consensus.

re: vi vs. emacs.

I've used both extensively but found that my love for both has declined along with my tolerances for cryptic key sequences that change depending on what type of file you are editing.
posted by KirkJobSluder at 8:08 PM on March 18, 2006


Oh, and if you set your editor to make tabs into spaces, you will eventually try to edit a Makefile and fuck it right up.
posted by nicwolff at 8:11 PM on March 18, 2006



Space Out Tabs
posted by Blue Stone at 8:17 PM on March 18, 2006


nano, BSD, water. Oh, and Celestial Avenger/Hindo's Doom, duh.
posted by Ryvar at 9:36 PM on March 18, 2006


10 If (Nerdfactor >1) Goto 40
20 ThreadRead=0
30 End
40 ThreadRead=1
50 Goto 10
posted by BitterOldPunk at 9:36 PM on March 18, 2006


(setq indent-tabs-mode nil)
(c-set-style "stroustrup")
posted by formless at 9:55 PM on March 18, 2006


nicwolff: that's probably vi's autoindent mode - when you start a new line it will insert a combination of tabs and spaces to line you up with the start of the previous line.

:set noai
posted by russm at 9:58 PM on March 18, 2006


nicwolff sez: Indentation is logical, not decorative

I would have to disagree. In a whitespace neutral language, indention is purely for human benefit, there is no logic inherent in the language that dictates spaces or tabs. If there were, we wouldn't be having this argument.

The only logic is that which pleases the human. I see no "logic" in your post that would dictate tabs over spaces. Whitespace is, IMO, in order to make code human-readable, hence it is an aesthetic function. The logic of it is so we can edit code easier, so of course, I guess, there IS a logic, but it's not in the language.


if (foo){
statement();
}

And for me? two spaces... I think when we learned Pascal in High School, we learned tab with it being 4 spaces.

Now, as for the others:

emacs (but I prefer nano or joe, so I'm a heretic, I guess), Linux, and if I'm gonna drink, I'm drinking straight Rumpleminze...

and Frostbrand!
posted by symbioid at 10:23 PM on March 18, 2006


True, but vi will insert a mix of tabs and spaces only if it finds a mix on the line above, right? Or is there some combination of tabstop and shiftwidth settings that makes vi do this terrible thing? (Wow, I've been using vi for 20 years with ts=2 sw=2 and I have no idea what other settings would do!)
posted by nicwolff at 10:38 PM on March 18, 2006


Ah, I get it - tabstop=8 shiftwidth=4 means that if you < or>> lines they'll end up indented with both spaces and tabs. But are there really enough people with that silly vi setup to account for all the code I've seen like that? Hmm...
posted by nicwolff at 10:44 PM on March 18, 2006


Embassy Regal!
posted by Joeforking at 11:17 PM on March 18, 2006


Bit 0 belongs in byte 0. Bigendians are the spawn of the devil.
posted by flabdablet at 11:18 PM on March 18, 2006


O RLY?

Do you write decimal numbers little endian? In that case the Iraq war would only cost $000003 per second!
posted by blasdelf at 11:31 PM on March 18, 2006


No, but the people who invented them do. The general flow of Arabic script is right-to-left; numbers have the big end on the left (i.e. last).
posted by flabdablet at 11:59 PM on March 18, 2006


Indentation and Brackets

I have before and right now do again nominate Guido van Rossum for Sainthood for Python's handling of code blocks. Not only are bracket wars moot, but at least a modicum of indentation discipline is forced on the programmer.

All hail Guido!
posted by tkolar at 12:10 AM on March 19, 2006


flabdablet wrote...
No, but the people who invented them do. The general flow of Arabic script is right-to-left; numbers have the big end on the left (i.e. last).

That would be a great argument if only the numbering system we used had been invented by the Arabs. It wasn't, it is Indian in origin.
posted by tkolar at 12:14 AM on March 19, 2006


I have before and right now do again nominate Guido van Rossum for Sainthood for Python's handling of code blocks. Not only are bracket wars moot, but at least a modicum of indentation discipline is forced on the programmer.

Yeah, but if you try to use tabs and spaces together it screws everything up. (Most Python programmers use spaces.)
posted by grouse at 12:57 AM on March 19, 2006


Oh my! Clearly the triviality of this topic is disputed :)

But very seriously for a moment, observe the sheer entrenchment - the sheer absolute certainty that you are right and everyone else is wrong - aroused by this issue and ask yourself if you've never behaved like that in a "real" debate. We are a sorry lot.
posted by hoverboards don't work on water at 3:00 AM on March 19, 2006


Tabs not spaces
Vi not emacs
if ( foo ) { (no linebreaks!)
Gnome not KDE
Linux not BSD
Debian not Redhat
AMD not Intel
Playstation not XBox

...I'm running low on religious wars, but i feel i've now successfully pissed everyone off.
posted by iso_bars at 3:03 AM on March 19, 2006


Upon reading the first link, I thought to myself: what, am I the only person who likes THREE spaces per indent?

I use tabs myself, because there's a nice delineation between levels of indent—not just visually, but also in the code itself (6 spaces could be three levels, two levels or a typo depensing on context; 2 tabs is 2 levels, no matter how many spaces you or the author uses per indent). However, I use an editor (Notepad2) that will markup tabs to show indent levels, so I may be biased.
posted by chrominance at 3:05 AM on March 19, 2006


Also, I think we can all agree: 8-spacers should be shot.
posted by chrominance at 3:05 AM on March 19, 2006


...I'm running low on religious wars, but i feel i've now successfully pissed everyone off.

Here, let me help:
Java, not .NET.
C++, not C.
Ruby, not Python.
Bash, not Csh.
posted by spazzm at 3:18 AM on March 19, 2006


But using tabs and spaces together is retarded, and the hand-wringing over having to pick which one to use is the reason for this war, and thus this FPP.

If you like Python's whitespace fascism, you should check out Haskell, the original whitespace nazi language. In the HUGS Haskell interpreter's default script format, lines not starting with a > are comments! Actual code needs to be "commented" in. With the Tabs v. Spaces war, in Haskell you have to pick one, and stick to it for each function. No mixing tabs and spaces. If you do, your code fails.

I tried to put Haskell code samples in this comment for both tabs and spaces, but apparently MeFi can't deal with either at all in <code> tags, and inserts lots of random linebreaks and other wierdness in <pre> tags.
posted by blasdelf at 3:19 AM on March 19, 2006


Boys, boys, boys; there's plenty more empty space outside, why don't we all just put down our editors of choice and go experience it?

function (parameters)
{
  functionality;
}

unless in CSS, when it's near pointless to make containment obvious. I'm happy to sacrifice a couple of hundred bytes per file for readability.


...no, I'm going. Look! I'm almost pushing back the chair...
posted by NinjaPirate at 6:09 AM on March 19, 2006


I love this post irrationally. When the end of the universe comes, humans will still be bickering about stupid little things like this. For some reason, that makes me smile. Thanks hoverboards.
posted by Popular Ethics at 8:23 AM on March 19, 2006


iso_bars, you heretic!

Tabs not spaces
vi not emacs
KDE not Gnome
Linux not BSD
Debian not RedHat
AMD not Intel
Nintendo not either of the evil duo

Since we agree on a lot, but have two areas of disagreement, it follows naturally that I must hate you vastly more than I hate someone who is more obviously wrong. Long live the forces of KDE and Nintendo, death to the heritics of Gnome and Playstation!

The difference between programmers and heritics is that programmers support KDE and Nintendo, while the apostate, who are not truly programmers, are doubtless duped by satan himself.
posted by sotonohito at 9:02 AM on March 19, 2006


I have found my nemesis.

If i'm ever in your neighborhood, satanohito, i'll throw a Playstation through your window, with a death threat (written with gedit) attached. I think you'll find that the brick-like nature of the PS2 is ideally suited to such a task.

I'm sure this will make you see the error of your ways. Although with KDE i bet you see errors all the time (ahahaha!)

Heretic!
posted by iso_bars at 9:34 AM on March 19, 2006


You guys just had to drag game consoles into this didn't you.

Nintendo FTW!
posted by grex at 10:20 AM on March 19, 2006


Tabs.

And, really, I'm not that invested in this argument. I only got pulled in because I worked in a mixed platform team on some Python project and no one was willing to sacrifice their space preferences. The only sensible solution was to abstract the preferred indentation to tabs. Since then the habit has stuck.

Since I'm here:
nano (emacs if I have to)
Linux
Gentoo
Gnome
Java > Python > your crappy alternative but that's only because I've not had the honor of picking up anything in the C family at this time

and
if( foo ) {
    ...;
}
else {
    ...;
}
posted by Fezboy! at 11:02 AM on March 19, 2006


except for the double spacing in the if/else block. WTF <pre>?
posted by Fezboy! at 11:04 AM on March 19, 2006


symbioid: Humans are logical too. The purpose of block indentation is to make the logical structure of the program apparent to the reader. It's not aesthetic; it doesn't matter how deep the indents are rendered as long as you can clearly see the nesting; you could translate tab depth into font size or text shading and it might work about as well.

Pushing broken parameter lists or comments over to line up with the part on the previous line is aesthetic; it has to be done with just so many spaces, and nothing else, or it breaks.

I can easily explain why two tabs means two levels of block nesting in my code. That's what I mean by logical. Can you easily explain why nine spaces means three levels of block nesting in your code?
posted by nicwolff at 11:15 AM on March 19, 2006


I'm a programing language slut. I'll use just about anything that strikes my fancy. I'll even use perl when I'm feeling like coming out of the experience dirty and degraded.
posted by KirkJobSluder at 11:19 AM on March 19, 2006


SPACES~!!!!!!!!!!!11
posted by delmoi at 11:37 AM on March 19, 2006


People! People! Don't you know that whitespace should be part of the language specification?
posted by breath at 12:02 PM on March 19, 2006



Don't you realize that whitespace should be the language specification?
posted by tkolar at 12:36 PM on March 19, 2006


KirkJobSluder...
I'll even use perl...

You know these threads are always fun, until someone like you comes along and pushes things way beyond common decency.

I'm reporting you to the administrators for obscenity.
posted by tkolar at 12:40 PM on March 19, 2006


I used to think tabs, but now think spaces. PEP 8 convinced me.
posted by winjer at 12:44 PM on March 19, 2006


Spaces, emacs, python (faut de mieux, though I do like it a lot), neither Gnome nor KDE (openbox works fine), linux.
if (foo) {
  relatively short suite;
}
or
if (foo)
{
   comparatively longer suite;
}
Don't ask why, I just observe this behavior. Like Emerson, I write in the modeline of my editor "Whim".
posted by kenko at 12:58 PM on March 19, 2006


bikeshed
posted by nml at 5:37 PM on March 19, 2006


Huh. I've always preferred

if (foo)
    {
    ...;
    }

but I guess I'm just weird. I feel like it helps me keep track of what lives at the level of the function, because all the lines included will line up with the open and closing brackets. If my end and start don't line up I know that I forgot to close something properly.

And, tabs. Why? Because if I need to un-indent something, I needn't delete 47 goddamn spaces per line to do it.

Also,
pico > vim > vi (bite me, I was GUI trained - be happy I use command line for anything)
slackware > any other distro I've tried
coke > pepsi
cats > dogs
hockey > basketball
Han Solo > Captain Kirk

Oh I give up. It's all pointless, really.
posted by caution live frogs at 10:00 PM on March 19, 2006


nintendo 4 life. kde blowz. i haven't gotten around to learning vi or emacs, where do you people find the time?
posted by MarkO at 10:25 AM on March 20, 2006


10 If (Nerdfactor >1) Goto 40
20 ThreadRead=0
30 End
40 ThreadRead=1
50 Goto 10
- BitterOldPunk

Well I've never done any programming (I get my geek cred other ways) yet even I could understand that, and indeed most of the thread. Cool.
posted by raedyn at 5:23 PM on March 20, 2006


function understandFrontPagePost () {
    if (getIt) {
        if ((witty && original) && (likeTabs || likeSpaces)) {
            _root.doApplause();
        } else {
            _root.leaveSnarkyComment();
        };
    } else {
        if (busy) {
            _root.moveOn();
        } else {
            _root.leaveEvenMoreSnarkyComment();
        };
    };
};
What's the big deal though? Most editors will strip whitespace for you after you've finished coding. Or am I missing something?
posted by sjvilla79 at 7:28 PM on March 20, 2006


« Older That's a lotta simoleans   |   Countess Dracula Newer »


This thread has been archived and is closed to new comments