Tab indentions on different platforms?

Ben Finney bignose+hates-spam at benfinney.id.au
Wed Jan 2 05:17:54 CET 2008


Torsten Bronger <bronger at physik.rwth-aachen.de> writes:

> [...] the width of a tab is nowhere defined. It really is a matter
> of the editor's settings.

RFC 678 "Standard File Formats" <URL:http://www.ietf.org/rfc/rfc678.txt>:

         Horizontal Tab  <HT>

            Moves the printer to the next horizontal tab stop.

               The conventional stops for horizontal tabs are every
               eight characters, that is character positions 9, 17, 25,
               ... within the logical page.

            Note that it is difficult to enforce these conventions and
            it is therefore recommended that horizontal tabs not be used
            in document files.

> I, for example, dislike too wide indenting. I use four columns in
> Python and two in Delphi. However, there are Python projects using
> eight spaces for each indentation level.

How many columns to indent source code is an orthogonal question to
how wide an ASCII TAB (U+0009) should be rendered. The former question
is open to matters of style; the latter at least is standardised, even
given the caveats about enforcement.

> If all Python code used tabs, eveybody could use their own
> preferences, for both reading and writing code, and interoperability
> would be maintained nevertheless.

Interoperability isn't the only criterion though. On the contrary,
source code is primarily for reading by programmers, and only
incidentally for reading by the compiler.

-- 
 \        "I hate it when my foot falls asleep during the day, because |
  `\         that means it's gonna be up all night."  -- Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list