Proposal: Official whitespace response

Forrest Cahoon fcahoon at my-deja.com
Tue Feb 15 15:24:36 EST 2000


In article <200002102304.KAA08105 at envy.fulcrum.com.au>,
  Richard.Jones at fulcrum.com.au wrote:
>
> Could we please maybe mandate an "Official Response" to the weenies
constantly
> posting about whitespace in Python?
>
> Something like:
>
> -------
> Subject: Official Response [Re: <insert original subject line here>]
> From: some_python_regular
>
> Guido van Rossum, the creator of Python, is not going to change this
> fundamental aspect of Python. We don't want him to. We all like it.
>
> If you wish discussion on this topic, please read the mailing list /
news group
> archives regarding the topic first:
>
http://www.dejanews.com/dnquery.xp?DBS=2&ST=PS&defaultOp=AND&LNG=ALL&format=thre
> aded&showsort=date&maxhits=100&groups=comp.lang.python&QRY=whitespace
>
> Any further messages with the subject line "<insert original subject
line here>
> " will be ignored.
>
> -------
>
> Suggestions welcome :)
>
>         Richard

As a "newbie" who made such a post recently, I can tell you what would
have been useful to me ... indeed, what would have made me feel it was
unnecessary to post.

I am a sort who would much rather be coding than arguing, and my
motivation was not to start a flame war.  I am a person who had heard of
python and thought that the whitespace thing was ugly, but proceeded to
simply use other languages (duh!) until it looked to me as if python's
popularity is becoming such that I may _have_ to use it.  Kind of like
C, you know.  Although I like C, I didn't choose to use it.  I have to.
As python's popularity increases, you will probably see more of my type
-- real programmers with better things to do than fight flamewars.

Inbetween all the bickering, I got a lot of useful information.  It
would be nice to summarize these points in a succinct, factual manner.

First and foremost, I did not find in the FAQ, or in any of my searching
around on www.python.org, or in any place in Mark Lutz's _Programming
Python_ that was clear from the TOC or index, or in the 1/3 of the tome
I've read so far, any sort of clue into the really incredibly obvious
question that is underneath all this: "How do you deal with tabs vs.
spaces?"

I don't know why this is so hidden.  I think any reasonable FAQ on the
matter must state, in some obvious and up-front way THE PYTHON
INTERPRETER ALWAYS INTERPRETS A TAB AS 8 SPACES.  There was a quote from
Guido's guide to programming style (or something like that -- NOT the
first document I'd look at when trying to figure out how the dang thing
works) that was quite to the point somewhere in the responses to my post
that was quite to-the-point which I think you should probably use.

You can pooh-pooh the objections to using indentation as syntax, but you
can't pooh-pooh the importance of understanding the mechanics of how it
is implemented!  Yet most of you pythoneers (who respond at all -- no
doubt many more are coding) would rather spend your time explaining why,
philosophically, it's not a problem, instead of describing how
indentation-as-syntax actually works.

Even if your interlocutors aren't specifically mention tabs vs. spaces
when they complain about whitespace, I think you can be safe in assuming
this IS the issue for 99% of them.  Address it.

(Personally, I'd feel more secure about python if tabs generated a
compile error, and thus could be guaranteed not to be in any running
code.)

The second thing of interest I learned is that there is a module called
pyindent.py (?) that is supposed to allow me to put redundant
information in my python code, if I'm really so silly as to be worried
about this whitespace thing.  Yes, I'm really that silly.  I'll probably
use pyindent.py (is that what it was called?)  More information would be
appreciated.

The third thing related to this issue that was educational for me was
the emacs python-mode keybindings that help deal with indentation.

So, yeah, write your position paper, say it's not a problem, whatever --
but put these facts in it.  At least, that's my advice.

... and I've probably written 30 lines of python by now!!!!

f




Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list