Tuesday, June 27, 2006

Damn you Tabs to Hell

Every time I enter a new workplace, I find myself looking up this essay: "Tabs versus Spaces: An Eternal Holy War". It fills me with a feeling of peace and serenity, and reminds me how to customize my .emacs file.

2 comments:

Ben Osheroff said...

this came up for me recently too, I proposed arm wrestling to resolve it, no one laughed.

The advice proposed in your link is utter crap, though, forcing anyone who edits your code to dink around with their editor until it conforms to your standard - instead of writing files with tabs and letting everyone's editor sort out what a tab means.

thus further alientating the vi users from the emacs users. perpetuating wars.

Chris said...

Dinking with your editor is not avoidable. By default, with the tab stops at 8 and the indentation set at 4, emacs will insert four spaces at the first indentation level, then one tab character at the next. The next indentation level will be one tab character plus four spaces. Needless to say, depending on the viewing editors tab stop settings, anything can happen.

I say this as a current emacs user and a former vim user, as someone who has no interest in holy wars, who just wants for everybody to get along and (hopefully) inter-operate. Changing two lines in your .vimrc or .emacs file is a small price to pay to avoid me wringing your fucking neck if you ever try to send me tabbed-up code.

I mean it Ben. Don't test me.