Who are the "spacists"?

Steve D'Aprano steve+python at pearwood.info
Sun Mar 19 20:42:22 EDT 2017


On Mon, 20 Mar 2017 06:00 am, Chris Angelico wrote:

> On Mon, Mar 20, 2017 at 4:29 AM, Steve D'Aprano
> <steve+python at pearwood.info> wrote:
>> I wonder whether the tabs versus spaces divide is closely aligned to the
>> Windows versus Unix/Linux divide?
>>
>> It seems to me that Unix users are typically going to be using Unix tools
>> which often assume spaces are used for indentation, and consequently cope
>> badly with tabs. I maintain that makes them "broken" tools, but broken or
>> not, that's the status quo and Unix users will simply deal with it by
>> using spaces for indents.
> 
> Nope. I'm on Linux and I love my tabs. They play fine with grep, diff,
> etc. None of my tools has a problem with them.

Hence my comment:

"I'm not even sure that it is true that tabs will break the Unix toolset.
But Unix users mostly believe it is true."

Perhaps I should have specified, *many* Unix users believe. Or "some" Unix
users. Or "the guys I work with".

Or perhaps "just that one guy": here is JMZ, who says it is "impossible" to
do anything with a text file unless you know what a TAB character
represents:

        I just care that two people editing the same file use the same
        interpretations, and that it's possible to look at a file and 
        know what interpretation of the TAB character was used, because
        otherwise it's just impossible to read. 

https://www.jwz.org/doc/tabs-vs-spaces.html


Jamie Zawinski is a clever man, but I've read that document probably a dozen
times over the years, and I still don't understand it. If I indent
something using tab characters:

        indent 1
                indent 2
        indent 1 again

why does JMZ need to know how many columns *I* choose to use to display
this? I could use 4 columns per tab, or 64, and not only is the source text
identical but the interpretation in terms of *indent levels* is the same.
And that's the only interpretation that really matters: whether something
is indented once, or twice, not the physical number of columns that takes
up on *my* screen.

JMZ's "solution" is to ban TAB characters from source files. I don't
understand why he thinks that solves *anything*. If anything, it makes it
worse: for example, in the above quoted paragraph, I deliberately indented
the quote by *two* indents, not one, but using a spaces. How can JMZ
distinguish between "one 8-column indent" and "two 4-column indent" when
spaces are used instead of tabs? I don't think you can. I think he is
working on the unstated assumption that indentation will never increase by
more than one level. If so, then he can easily read:

        indented text
        more indented text

as a single 8-column indent. And he'll usually be right, until he keeps
reading and find:

        still more indented text
    outdented by half a level text?


I find myself using spaces because it is the path of least resistance, and
the tools I use make it tolerable. But for the life of me I still cannot
understand the *logical argument* against tabs.





-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.



More information about the Python-list mailing list