[Edu-sig] quantum instance

Arthur ajsiegel at optonline.net
Thu Sep 15 12:57:40 CEST 2005



> -----Original Message-----
> From: Kirby Urner [mailto:urnerk at qwest.net]
 
> > If you want to see me as a confused student - you're welcome.
> >
> > Art
> 
> I don't see you as confused. 

Can't we agree about anything?  

I'm confused I tell you ;)

Scott David's Triangle did *not* use a property for area. I think that was
quite purposeful.

OTOH, his general explanation for the use case of properties in respect to
API design seemed to me to be a perfect defense of the extensive use of a
pattern of:

@property
def getx(self):
   return self._x

@porperty
def sety(self,x)
   self._x =x

because while now x is a normal attribute you never know what tomorrow may
bring.

OTOH, as you point out Alex did use exactly your case of the area of a
Triangle to illustrate properties in Nutshell.  Was he simply illustrating
mechanics or, in so doing, advocating a use case as well? 

Would we have flatted the area method before properties, through the
__getattr__ mechanism.  Were properties put into the language to make it
more convenient for us to do this kind of thing - *as a way of encouraging
this kind of pattern*.  I think you - implicated or explicitly  - think yes.
I think I explicitly think no.

John and Dethe point out that when a color attribute in vpython is changed
the proverbial e-mail to Mary needs to be sent - rerender.  Before
properties it was done under the covers, now we have the convenience of
properties as an alternative.  The unambiguous use case, IMO.

John feels the appearance of properties in the language to be an unambiguous
win.  I would probably agree if I didn't believe it had the side effect of
having some of us second-guessing the way they did business pre-properties.

I guess I am pleading for constraint in the presentation of properties to
novices, with clear *and narrow* use cases.

Its part of my campaign for this year's Willison award. I'm think my chances
are 50/50, best case ;)

Art



    





More information about the Edu-sig mailing list