[NCLUG] Looking at programming languages...

Duncan McGreggor duncan.mcgreggor at gmail.com
Thu Jan 17 16:05:01 MST 2008


Bob Proulx wrote:
> Duncan McGreggor wrote:
>> Walker, Philip M (Optical Storage) wrote:
>>> the indentation relies on the assumption that tabs (if present) are 
>>> unambiguously equivalent to 8 spaces.
>>>
>>> Of course, that assumption is not valid unless your editor is configured 
>>> that way
>> I don't know of any python programmer that uses 8 spaces for indent. I
>> use 4 (with vim). The twisted python coding standard dictates 4. What's
>> more, the official python coding standard
>> (http://www.python.org/dev/peps/pep-0008/) suggests 4, saying that 8
>> should only be used if necessary (e.g., legacy code).
> 
> You are confusing TABs with indention.  Those are two completely
> separate concepts.  One does not dictate the other.

[snip]

> Fun comment in the Linux kernel Documentation/CodingStyle file by
> Linus Torvalds:
> 
>   Tabs are 8 characters, and thus indentations are also 8 characters.
>   There are heretic movements that try to make indentations 4 (or even
>   2!)  characters deep, and that is akin to trying to define the value
>   of PI to be 3.

This seems to have become a semantic discussion and I do believe that 
Linus Torvalds is full of crap here.

A "tab", as we all know, comes from the days of typewriters (where I 
started, and probably many of us did). A tab is a flexible *location*, 
not measurement. The first tab stop could have been at any point, 
likewise for all subsequent stops. Computer printers worked like this at 
first too, before an *arbitrary* length of 8 characters replaced the 
programmable tab stop convention.

Defining a tab to be 8 characters is like trying to insist that all 
circles have a unit radius or 1, regardless of Pi and relative sizes. 
It's simply a convention now, and there's no rational reason why that 
convention must be adhered to like a law of nature. That's a little 
maniacal, me thinks.

Regardless of the definition and origin of tab/tab stops, the points I 
made about python and the coding standard remain: the complaints made by 
Phil are issues that one sees with newbs and are not only not endorsed 
by the python community, but actively vilified.

d



More information about the NCLUG mailing list