On Fri, Jun 26, 2009 at 4:27 PM, James Gregurich<bayoubenga...@mac.com> wrote:
> ok. What percentage of cocoa classes will exhibit the behavior you describe? 
> I've never seen an objc class that mysteriously hangs around beyond the 
> destruction of its dependencies (including any autorelease pools that contain 
> it). I wouldn't be shocked if there were some....maybe some system singletons?

100% might.  Maybe 0% today, and then tomorrow Apple might release an
update that causes all objects to hang around forever.  You don't
know, and you shouldn't care.

> If 90% of objc classes are completely deterministic in their life cycle 
> behavior with retain/release and 10% aren't, I'll not use the 10% to make the 
> case that I should introduce even more entropy into my system by using 
> garbage collection.

If this is your attitude you're unprepared for the reality of modern
software development.  And I suggest you never touch NSFont, NSColor,
NSWindow, or NSMenu; they might stick around longer than you intended!

> GC isn't nirvana.  it does have its perils and issues, and you have to be 
> aware of them and code around them. You can't just turn it on and some how 
> everything magically works. There is no perfect solution to memory 
> management. I prefer a  solution where I manage the dependencies and objects 
> go away in an orderly fashion based on the dependency graph for those objects.

Then Cocoa's obviously not your cup of tea.

> additionally, I find the notion of adding an extra subsystem that 
> periodically scans memory looking for pointers to be foolhardy. my code 
> already knows what needs to be cleaned up and when. I don't need a system 
> sitting in the background scanning memory trying to clean up behind me.  All 
> I need is a mechanism to do the cleanup in a maintainable and extensible 
> manner.

"My code already knows how it's going to use its memory; why should we
have some stupid little chip -- watchyacallit, an MMU? -- to do that
for me?"  The creators of garbage collectors don't consider them to be
panaceas.  There are a very well known class of problems which GC
utterly fails in.  There's also a rather large class of problems which
can only be solved (that is, solved by a programmer within a normal
human lifespan) with some form of automatic garbage collection.  The
Lisp guys can probably come up with boatloads; after all, they've had
since the late 50's.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to