paulsid at home.com
Sun Jul 1 21:37:06 EDT 2001
Roy Smith wrote:
> Having now used python for about 4 years, I still think
> indentation-for-grouping was a dumb idea. The problem is that it is just
> too easy to add or delete whitespace by accident (and without noticing),
> especially when cutting and pasting hunks of code from one place to
> another. When such whitespace munging makes the code look ugly, it's
> simply a minor annoyance. When it changes the meaning of the code, it's a
> language design mistake.
I have to disagree here. I think this is one of the cases when forced
indentation is most valuable. It requires you to inspect the code more
closely so that you KNOW the code was pasted in the way you wanted it.
(This also helps avoid those cases when you're cutting-and-pasting to
make similar blocks of code and you forget to change one of the
blocks.) It also helps maintainability, because you don't end up with a
mess of differently-indented blocks. (Personally I almost always fixup
the indentation immediately in any language (C, Pascal, even HTML) so I
hardly even noticed that it was required in Python.)
Also, I can't count the number of times that I've been cutting C/C++
code and missed a brace. That's a minor thing, but it's nice to not
have to worry about it in Python.
Anyhow, I don't want to say anything more about indentation since it's
probably all been said 2000 times over already.
> The reason people rarely beat up on it anymore is becuase it's a lost
> battle. I continue to use python (despite the indenting problem) because
> there is enough other stuff in it that I like. But I don't think it's fair
> to call it a "knee-jerk reaction".
I don't think that was the implication. I think "knee-jerk" was just
referring to the fact that almost anybody who's done programming in any
mainstream language does indeed react with varying degrees of
"WTF-is-this"-ness when they see Python's indentation characteristics
for the first time.
That being said, you're right - I'm sure there is a sizeable contingent
of experienced Python programmers who dislike the indentation, and that
opinion is definitely valid. But I don't get the sense that opinion
isn't respected. I've only been on python-list/clp for a few weeks, so
when the anonymous person posted "the indentation for grouping thing" I
was expecting her/him to be dismissed as a troll almost immediately.
Instead there was a reasonable discussion about the matter, even though
(as is almost always the case) nobody changed anybody's mind. To me
that said a whole lot!
Paul Sidorsky Calgary, Canada
paulsid at home.com http://members.home.net/paulsid/
More information about the Python-list