Tabs -vs- Spaces: Tabs should have won.

Thomas 'PointedEars' Lahn PointedEars at web.de
Sun Jul 17 15:10:42 EDT 2011


Thorsten Kampe wrote:

> * Thomas 'PointedEars' Lahn (Sun, 17 Jul 2011 14:35:15 +0200)
>> Thorsten Kampe wrote:
>> > * Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500)
>> >> I still don't understand. Whitespace to the left of an assignment
>> >> to signify an indent and whitespace around operators to align
>> >> values (in a multi-line assignment) are not the same.
>> > 
>> > When I'm (consistently, of course) indenting code, I'm aligning it.
>> > When I'm aligning code, I do this by indenting it, see for instance...
>> > 
>> > firstvariable = 11
>> > variable      = 111
>> > 
>> > firstvariable = 22
>> > variable =      222
>> > 
>> > The second "=" and the "222" is indented.
>> 
>> You might want to check your English dictionary.  Indenting is commonly
>> understood in typography as "To begin (a line or lines) at a greater or
>> less distance from the margin"¹.  In particular, in computer programming
>> it usually means that there is, at most, whitespace on the left of the
>> text.² In that sense, the above is _not_ indentation (or indenting), as
>> neither "variable" nor "variable =" consist only of whitespace.  It is
>> only aligning.³
> 
> *doublesigh* that is actually the point I was trying to make.

Well, you said you would "align code *by indenting*", which is either 
nonsense following the not-so-uncommon definition of "indenting" that I 
presented, or you chose a particularly bad example to make your point
(as it does not feature indentation at all).

> From a programmer's point of view the distinction is artificial because he
> does essentially the same: press the tab key

But he should not, unless he uses the Tab key to insert spaces, because the 
*display width* of the Tab *character* is variable.  *That* is the point!

> or the indent button to move the stuff right from the cursor to the right
> so it gets aligned with the stuff above.

"Indent button"?

-- 
PointedEars

Bitte keine Kopien per E-Mail. / Please do not Cc: me.



More information about the Python-list mailing list