Tabs vs spaces in code (was: Emacs auto-modes and tabs)

Jason Stephenson jason at sigio.com
Thu Apr 17 10:50:01 EDT 2003


As a corollary to Ben's post, I've never really bought the argument that 
tabs are more prone to error than spaces, even though I use spaces 
because that's what most of the projects that I've worked on used. If 
you think about it for even 5 minutes, tabs would really be better 
because as Ben mentions you're specifying levels of code indentation and 
the programmer can decide in her editor how many spaces to give to a 
tab. That way, we all see the code how we want to see it: two spaces, 
three spaces, four spaces, or eight.

The reason, I think, that so many people clamor for spaces is that they 
want to read diffs in their email program before applying it. Most MUAs 
have problems with tabs, and if it is set to some large value like 8, 
deeply indented code will wrap onto following lines and then look really 
ugly.

It doesn't really matter which is used in a file, and there is only one 
language that I know where it matters at all to the compiler or 
interpreter. It really only matters to the people reading the file, 
which is why it seems like a pointless argument to me. You just use 
whatever everyone else is using on the project, and that's the other 
benefit of being a project lead: you get to pick the indentation style.

Now, let's talk about where to put the braces in C and how to configure 
that in Emacs. ;-)





More information about the gnhlug-discuss mailing list