Is it advisable to replace 'self' with '_' or 'I' or something shorter?
Grant Edwards
grante at visi.com
Sat Jan 11 13:43:09 EST 2003
In article <ThZT9.98$B62.32373 at news.uswest.net>, Kevin Altis wrote:
> The most common is probably 's'. However, it makes it more difficult for
> other people to read your source if don't use 'self', so it isn't advisable.
> You might consider binding a "macro" to type out "self." if typing the
> characters bothers you
I don't know about the OP, but I don't care about the typing. That's NRE.
It's the reading that's a problem. If you've expressions like
(((a+b)/c)*(d-x))-y
they end up looking like
(((self.a+self.b)/self.c)*(self.d-self.x))-self.y
I have a much easier time grokking the former. In some cases you end up
with lines 100+ characters long instead of 20 or 30.
Using local variables helps...
--
Grant Edwards grante Yow! I want to kill
at everyone here with a cute
visi.com colorful Hydrogen Bomb!!
More information about the Python-list
mailing list