Tab indentions on different platforms?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Dec 29 19:37:32 EST 2007


On Sat, 29 Dec 2007 15:29:25 +0000, Thorsten Kampe wrote:

> I'd personally go for spaces because:
> 
> 1. I don't like things I cannot see (control characters)

You can see spaces but not tabs? Your editor is pretty weird. In all the 
editors I've every used, both spaces and tabs show up as empty white 
space. (Or coloured space if I set the editor to use a coloured 
background.)


> 2. I never had problems with spaces but plenty with tabs

Periodically, I ask on this list what problems people have with tabs. 
(I'm fully aware that mixing tabs and spaces is a Bad Thing.) I've had 
little luck getting any answer except "Tabs are bad, m'kay?".

I'm only aware of two problems that some people run into due to the 
consistent use of tabs rather than spaces.

* Some news clients don't display tabs correctly, thus making it hard to 
copy and paste code direct out of the news reader into your source;

(But of course if you copy code using spaces, and the number of space 
characters used per indent level doesn't match your source code, you'll 
have problems too.)

* Some applications "helpfully" convert tabs into spaces, thus meaning 
that when copy code from them, you end up with spaces instead of tabs.

What problems have you had with tabs that aren't related to buggy 
applications or users that mix tabs and spaces?



-- 
Steven



More information about the Python-list mailing list