On Jun 11, 2008, at 6:07 PM, Paul McNett wrote:
> Okay, it is a matter of tidiness, and part of being tidy keeps the
> initialization of a property attribute with the property, not with the
> containing class.
>
> I think it just comes down to having 2 places to refer to the
> attribute,
> instead of one. What I meant by "encapsulation" in a prior message.
OK, I can see that reasoning.
> Another slight pro to my way is that if you never refer to a given
> property, the attribute never gets defined, as opposed to perhaps
> defining unneeded attributes when the class is instantiated.
That sounds like micro-optimization at the expense of legibility. A
little too much "magic" for my taste.
> And what is gained by defining the property attributes 'up above'? I
> have to reject the ability to comment on their use, as that would be
> self-explanatory from within the property definition.
It's simply a matter of style. For me, it's cleaner to define things
up front; perhaps it's a holdover from years of long LOCAL statements
at the top of every VFP method I wrote. It's probably also a habit I
picked up before we settled on the Dabo practice of property-centric
development; in most of the Python world, it's common to define a
plain attribute, and only property-ize it when necessary, as opposed
to the Java-like practice of having to write get/set for everything.
It's also dead simple to do, since my TextMate macro creates the
declaration along with the property definition and get/set code.
> But this isn't really worth arguing about, either.
I'm enjoying this, actually. For once it isn't devolving into an
argument.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]