Re: How far with accessors?
Re: How far with accessors?
- Subject: Re: How far with accessors?
- From: Marcel Weiher <email@hidden>
- Date: Thu, 27 May 2004 22:09:01 +0100
On 27 May 2004, at 16:33, Ondra Cada wrote:
Marco,
On 27.5.2004, at 16:09, Marco Scheurer wrote:
I don't want to go back to the whole debate about the benefits (or
lack of them) of autoreleasing accessors, but this doesn't make sense
too me.
I would recommend to go back to it ;) to read it thoroughly -- the
reasons were explained there, umpteen times.
Yes, the reasons why autorelease accessors are harmful were explained
umpteen times, but some people...
Presumed that in an ideal case, unless there are strong reasons
otherwise,
Quite the contrary: Occam's razor and DTSTTCPW both clearly say that
you should only do something "extra" if there is a compelling reason
for it, which there isn't.
*** a vended object should remain valid in the scope of the current
autorelease pool *** ("the presumption")
the reasons are self-evident.
Which reasons are those? The ones of there not actually being any
practical tangible benefit? The ones that the "new" rules add
complication because they aren't uniformly applied. The ones that
debugging becomes more difficult, memory consumption increases,
runtimes increases severalfold...
(Well I do know you and Marcel and probably more people don't think the
presumption is right.
No, it's not that we "think" this. We have provided ample reasoning
and evidence for this, whereas all the reasoning for autoreleasing
accessors evaporates under closer scrutiny, and no evidence of their
benefit has so far been provided.
On the other hand, others, including at least
some of the Cocoa implementors themselves, do; the combination of an
autoreleasing setter and plain getter or otherwise is actually
recommended in the docs. Therefore, let's decide anybody for himself.)
Yes, based on *reasoning*.
otherwise I see no reasons why your dealloc should use autorelease
instead of release
Namely: if you don't use autoreleasing getter, you have to use
autoreleasing setter
You don't have to do either of these.
and dealloc both *so as to fulfill the
presumption* (of course you may NOT WANT TO, but that's a different
question).
Assuming that presumption to have any validity, which it does not.
as you know in my opinion, not less robust
Also in the sense of the presumption (and only in this sense) is the
autoreleasing getter definitely more robust, for it ensures the
presumption in wider scope of situations (namely, in case the setter is
used inside of a nested autorelease pool).
The combination of "in the sense of the presumption" and "definitely"
does not make sense, because there is a contradiction.
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
1d480c25f397c4786386135f8e8938e4
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.