Tabs versus Spaces in Source Code

Brian Quinlan brian at sweetapp.com
Mon May 15 13:25:42 EDT 2006


Edward Elliott wrote:
> Tab is not 4 spaces.  Tab is 1 level of indentation.  The confusion that
> tabs equals some fixed width, or can/should be set to some fixed width, is
> the entire problem hampering their use.  It implies that conversion between
> tabs and spaces is straightforward when it is not.  They are not comparable
> entities.

The problem with tabs is that people use tabs for alignment e.g.

def foo():
   ->query = """SELECT *
   ->  ->  ->   FROM sometable
   ->  ->  ->   WHERE condition"""

Now I change my editor to use 8-space tabs and the code is all messed 
up. Of course, a very disciplined group of people could be trained to 
never use tabs except to align with the current block level but, in 
practice, that doesn't work. Therefore tabs are bad.

Cheers,
Brian



More information about the Python-list mailing list