A better self
Tom Loredo
loredo at astro.cornell.edu
Thu Jul 18 16:27:44 EDT 2002
Huaiyu Zhu wrote:
>
> However, there are situations, mostly in numerical computations, where it is
> necessary to have, say, a dozen variables in one expression, and a dozen
> statements containing such expressions and some other statements in one
> method. It is far more readable to have them all appear in one screen in a
> form that resembles written equations on paper, than to dogmatically follow
> a convention in a particular programming language.
Extremely well put.
I've been using Python almost exclusively for scientific programming in
the past 3 years or so. I've followed threads about many controversial
aspects of Python (additions or long-held characteristics), and I've
been impressed time after time with the choices of the development team.
Even when my first instinct has been to disagree with a choice or policy,
I have always come to see a great deal of wisdom in the final choice.
But the one thing that continues to irk me about the language is "self,"
for just the reasons Huaiyu describes. I think non-numerical programmers
are likely not in a position to appreciate the awkwardness of "self..."
in numerical settings, where in a many-variable expression it serves
to hinder understanding (by making the expression very long, often
broken across multiple lines) rather than to enhance it. Yet I think the
general arguments for "self" are strong and valid. Though I often wish there
were something like a "with" statement in such contexts, Huaiyu's
suggestion seems like a reasonable middle ground.
But if there were a "with" statement, I'd probably welcome it!
Cheers,
Tom Loredo
More information about the Python-list
mailing list