[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Philosophical Question On Naming



On 4/23/07, * Kris Schnee* <kschnee@xxxxxxxxxx>
    Is it better to call it " self.location" or
    "self.rect"?

By all means name variables according to their use rather than their concrete data type.

In this case I would probably go for something like
"bounds", since "location" sounds more like a point
than a rect to me.

Also in this case calling it "rect" probably isn't
all that bad, since it's fairly obvious what the
"rect" of a widget means. In fact I've done just
that in my Albow library. But that was written in
a considerable hurry for a PyWeek entry, so it
doesn't entirely follow what one might call best
practices. :-)

--
Greg