Tabs versus Spaces in Source Code

Ed Singleton singletoned at gmail.com
Tue May 16 04:54:47 EDT 2006


On 5/15/06, Brian Quinlan <brian at sweetapp.com> wrote:
> 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.

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

That would solve it.  Tabs for indentation, spaces for spacing.

Ed


More information about the Python-list mailing list