Re: accessor generation???
Re: accessor generation???
- Subject: Re: accessor generation???
- From: Michael Gersten <email@hidden>
- Date: Mon, 15 Jul 2002 21:45:02 -0700
One benefit of automatic accessors and memory management:
Done right, you'll never need to code a retain or release, unless you explicitly say 'alloc' or 'copy'.
Anything you get from something else is either used immediately, and allowed to autorelease, or put into an ivar. When you clean yourself up, you set all your ivars to null.
Much easier to say "The rule of allocation is: Any 'new', 'alloc', 'copy', or 'mutableCopy' must 'release' the copy before returning from the routine in question. Storing in an ivar or a collection is the way to keep it for later."
Cryx wrote:
>
>
On Tuesday, July 9, 2002, at 09:38 AM, Matt Neuburg wrote:
>
> One problem - the biggest problem - is memory management. Beginners find
>
> this confusing. [...] This makes a huge difference when you're just
>
> starting out
>
> and sigbussing your way down in flames all the time (or, contrariwise,
>
> leaking out the wazoo).
>
>
While I may agree with your other points, I believe that learning memory
>
management is a crucial component of programming in any language. Using
>
auto-generated accessors to gloss over memory management is probably
>
more damaging than an up front effort at understanding the basic
>
principles. When it is time to debug ref count issues, the lack of
>
understanding will make that task all the more difficult.
>
>
Daryn
>
_______________________________________________
>
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.
--
I am a Mac OS X-Cocoa/WOF/EOF developer, and I'm available for hire. Please contact me at michael-job @ stb.nccom.com if interested. Resume at
http://resumes.dice.com/keybounce
_______________________________________________
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.