Deprecate tabs for indenting (was Re: Indenting with tabs vs spaces)

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Dec 5 18:25:10 EST 2001


Huaiyu Zhu wrote:
> 
> So I'd suggest the tab advocates to consider the other side's view.

And vice versa as well. To give one concrete example,
BBEdit on the Mac is very definitely what Huaiyu
calls a "tab-character" editor, both in what happens
when you press the tab key, and in the way its
block-shifting commands work.

If Python were ever to mandate space-only indenting,
I would be very disappointed, since it would effectively
make it impossible to use BBEdit to write Python code.

I also recognise that mandating tab-only indentation
would cause equal distress to those with editors of
the other kind. So, as far as I can see, both styles 
need to be allowed.

I understand that problems occur if you take a file
produced using one kind of editor and directly edit
it with an editor of the other kind. But this seems
to be unavoidable giving the existence of these two
mutually incompatible editing regimes, or communities,
or whatever you want to call them.

Mandating one style of indentation doesn't solve this 
problem, it only shuts out half of the community.
And I don't think that would be a nice thing to do.

In summary, my positions on the various issues are:
* Space-only block indentation should be allowed.
* Tab-only block indentation should be allowed.
* Mixed indentation should probably be rejected always,
  or at least by default, although I can live with having 
  to say -tt.
* Python shouldn't care about spacing used for purposes
  other than block indentation, although pragmatically
  it's best done with spaces only.
* People in both camps should get used to the idea of
  using conversion tools to deal with each other's code
  and stop hating each other, or George Bush may target
  you next after Afghanistan. :-)

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list