Non-Indented python

Peter Hansen peter at engcorp.com
Sat Nov 24 09:21:47 EST 2001


Huaiyu Zhu wrote:
> 
> Marcin 'Qrczak' Kowalczyk wrote:
> >This would be a bad idea:
> >- using tab width of any other size than 8 is evil,
> >- 8 is too much for indentation in programming; 2 to 4 is good.
> 
> There are really two issues involved:
> 
> If everything can be redesigned from scratch, what would be the best
> indentation method for languages like Python's?  There is a strong argument
> for one tab character per indent level. When indentation is encoded as the
> number of tab charactors, code can be exchanged between different
> programmers completely unaffected by the display style.  The editor might
> even display it as charactor like this:

There's a stronger (IMHO) argument that using *only spaces* would
be a more appropriate redesign.  But since that would cause too much
trauma for many people who perhaps can't adjust, it would be more
pragmatic to open it up to people who "need" to use tabs.  

Unfortunately, since the definition of a tab is ambiguous and 
inconsistent, one would have to suggest a *preferred* definition,
such as the one *most commonly used* throughout the world of
computing, which would be a tabstop of 8.

Unfortunately, some people insist on using tabs with tabstop 
sizes other than 8, so one would perhaps open up the language
to those people by allowing them to use their atypical tabsize,
provided they were to do it consistently.  

In the end, if people mixed tabs which were not the typical
size with spaces, there would not be much one could do except
repeatedly recommend in newsgroup postings that they change
their editors to use spaces instead of inserting TAB characters,
or that they stick with a tabstop of 8 as the standard.

Deciding how much of a redesign of Python this new specification 
would require is left as an exercise for the reader....

-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list