John Siracusa has initiated an interesting discussion about automatic memory-management vs Cocoa's retain/release system… I can see the arguments for both sides.
It's handy in Java to not have to worry about releasing objects after using them. It's also neat in Objective-C/Cocoa, at times, as you can *almost* have the best of both worlds with NSAutoreleasePools ("autoreleased" objects are collated into the pool, and either released by the application at certain times, or when you release a pool you created) and retain/release methods. It's also neat when writing a for loop dealing with lots of data, to be able to say "I definitely don't want this hanging around in memory any more! Get rid of it!", without having to wait for the garbage collector to pick it up (and the memory usage going up in the process).
Would automatic memory-management be useful? Sure. I'd spend less time making sure I'm properly retaining/releasing objects, but I'm not going to lose any sleep over it (actually… maybe I am, given the time I'm writing this post). The Cocoa (and related APIs) are great to use, and if I have to put up with "semi-automatic" memory management, then so be it!








A well-tuned garbage collector as part of the Cocoa run-time might not only improve programmer productivity, but also execution speed. See the bit about how a conservative Boehm-Demers-Weiser garbage collector improved application performance in http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html
Hi Keith!
Thanks for the link and comment. I’ll check it out… Looks interesting!