Indentation style...

Ken Peek Peek at LVCM.comNOSPAM
Mon May 28 12:52:06 EDT 2001


<<<<< OK OK OK ALREADY !!!!!!!! >>>>>

In reading the posts from others on this group, I have had a "mind adjustment".
It looks like I am full of s**t on this issue, and that "tabs" are inherently
evil (in source files) for a multiplicity of reasons.

I therefore withdraw my post-- and recant my beliefs on this issue.  Because of
this discussion, I also plan on changing the way I write source code (to use
only spaces and NEVER tabs) as this appears to be the only way to insure the
code will look and work the way I intend over many different systems and
editors.

I have always used 4 spaces for indentation, but now that I know this is the
"semiofficial Python standard", I will make sure all source I write or work with
in the future meets this standard.

To remove the use of tabs in Python would probably break a lot of working code--
so we can't change it so that tabs are not allowed (which, after reading the
information here would probably save a lot of headaches.)

If I ever get the chance to invent that weird language rolling around in the
back of my mind, I will make sure to get it right in the beginning, and make
"tabs" illegal.

Thanks everyone for the hard lesson--

--Ken Peek


"Ken Peek" <Peek at LVCM.comNOSPAM> wrote in message
news:th2fnjl9qevaa at corp.supernews.com...
> Python allows the use of spaces or tabs (but not both!) to indent with.  I
think
> this was a mistake.  I think tabs should be forced at the beginning of lines,
> and spaces should be forced after the first printable character is typed.  The
> exception to this rule would be an empty line, and multiline strings.
>
> This indentation strategy would then be enforced by the interpreter/compiler.
>
> This will allow the programmer to set their editor to display a tab at
whatever
> indentation spacing they like, and the original structure (which is part of
the
> documentation of the code) is preserved.
>
> Most people that try Python at first hate it's indentation paradigm.  BUT--
> after a while they get used to it, then start liking and appreciating it very
> much.  I think the reason is that on a large project with many programmers,
the
> code has a tendency to kind of "look the same"-- making the code written by
> others easier to read and understand.
>
> Forcing tabs on the beginning of lines, and forcing spaces (for white space)
> after the first printable character (except for null lines and multiline
> strings) would be consistent with the philosophy of forcing "highly readable"
> code to be generated.
>
> Comments?
>
>
>





More information about the Python-list mailing list