Tab indentions on different platforms?
Thorsten Kampe
thorsten at thorstenkampe.de
Mon Dec 31 03:43:59 EST 2007
* Steven D'Aprano (Sun, 30 Dec 2007 23:28:50 -0000)
> On Sun, 30 Dec 2007 20:33:19 +0000, Thorsten Kampe wrote:
> > * Steven D'Aprano (Sun, 30 Dec 2007 00:37:32 -0000)
> >> 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.
> >
> > That's because the editor displays those invisible tab control
> > characters as something they're not: spaces.
>
> Editors display tab characters as "indent to next tab stop". That's what
> they're for, and any editor that doesn't behave that way is buggy.
>
> Tab characters are no more invisible than space characters. How can you
> see space characters but not tabs? Why aren't space characters invisible
> too? Why do you dislike tabs *specifically* because they are invisible,
> but like invisible spaces?
If you can't see spaces then that's your problem. I can see (identify)
spaces (at least at the beginning of a line).
> >> > 2. I never had problems with spaces but plenty with tabs
> >>
> >> What problems have you had with tabs that aren't related to buggy
> >> applications or users that mix tabs and spaces?
> >
> > Fortunately I don't remember every incident when I stumbled about
> > something weird behaving or looking. One thing I do remember is reading
> > python source code (not my own) with a pager. The source code was badly
> > indented. The pager was not "buggy".
>
> Given the constraints of the typical pager one-line display, and the
> tendency of pagers I've seen to arbitrarily drop leading whitespace *of
> any sort* from the start of lines, I'd like to know how you could tell
> the indentation was wrong.
It was obvious because the blocks didn't make sense.
The problem with tabs is that they're interpreted: by Python and by
the editor or pager to display them. Spaces are just spaces.
Thorsten
More information about the Python-list
mailing list