Another newbie question

Mike Meyer mwm at mired.org
Sat Dec 10 22:56:12 EST 2005


aleax at mail.comcast.net (Alex Martelli) writes:
>     def setRho(self, rho):
>         c = self.fromPolar(rho, self.getTheta())
>         self.x, self.y = c.x, c.y
>     def setTheta(self, theta):
>         c = self.fromPolar(self.getRho(), theta)
>         self.x, self.y = c.x, c.y
>
> That's the maximum possible "difficulty" (...if THIS was a measure of
> real "difficulty" in programming, I doubt our jobs would be as well paid
> as they are...;-) -- it's going to be even less if we need anyway to
> have a method to copy a CoordinatePair instance from another, such as

It's a trivial example. Incremental extra work is pretty much
guaranteed to be trivial as well.

> Really, I don't think this makes a good poster child for your "attribute
> mutators make life more difficult" campaign...;-)

The claim is that there exists cases where that's true. This cases
demonstrates the existence of such cases. That the sample is trivial
means the difficulty is trivial, so yeah, it's a miserable poster
child. But it's a perfectly adequate existence proof.

       <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list