TABs (was: Waffling between Python and Ruby)
Mark Hammond
MarkH at ActiveState.com
Mon Jun 19 07:30:36 EDT 2000
"Just van Rossum" <just at letterror.com> wrote in message
news:l03102800b57372d82b38@[193.78.237.140]...
> Using spaces-only is a safe solution, but only if you are absolutely
sure
> you never want anyone to use a proportional font to view your code...
(For
> those of you who have never used proportional fonts before <wink>: the
> width of the space character varies from font to font (as it should);
this
> means spaces are pretty much useless as indentation!)
I agree 100% with your sentiments!
But Im not sure I understand the above.
If you indent with leading spaces, then presumably all leading spaces will
be rendered in the same font. So even for proportional fonts, the code
should align correctly with spaces or tabs.
For alignment of anything other than the first non-space character (eg,
attempting to align a table, or a parameter list that spans
multiple-lines, for example), then if you use tabs, you are back in the
same position that started this thread - you are making some assumption
about the location of the tab-stops, or an assumption about the width of
the previous characters.
So I simply can not see a solution for ensuring _all_ code is visually
indented correctly when using purely tabs with a proportional font.
Let me know if I am wrong - I use a proportional font myself, and added a
quick toggle-between-fixed-and proportional command to Pythonwin purely to
get around this problem - Im forced to switch to fixed-point and using
spaces for non-leading indents...
But-generally-I-just-let-auto-indent-do-it-right-ly,
Mark.
More information about the Python-list
mailing list