OS X’s Objective-C garbage collection

Lately it’s been buzzing around on various blogs that in the next OS X release, Leopard, Objective-C can use garbage collection. For those who’ve been following the introduction of environments like Java, .NET and all other environments with the sligthest whiff of managed memory have seen the same crap all before.

Basicly there are two camps. Those that think automating memory mangement is a piece of crap and that anyone willing to use such “vulgar” mechanisms should be locked away carrying a straight jacket. And those that understand that it’s a good thing since it save complexity on the developers part.

Now this is stated a bit black and white. There’s a lot of gray between the two opposites. But isn’t it true that most applications are constrained by basic I/O speeds and user input rather then by the bit of extra work happening because of some memory reclaiming thread?

Now I haven’t gone into the details of Objective-C’s memory management model yet. But based on my limited observations sofar, the memory management is optional. So if and when absolutely every last instruction counts, yes you can stick to manual management. And then it is absolutly justified to do so. But in all other cases where that extra bit of CPU is not really noticable, why bother with manually managing your memory when in most cases it is just a tedious error prone exercize anyway. Better to save the hours to add functionality then to comb through bits of code to find that nasty memory leak.

I’d say hooray for garbage collection in Leopard and Objective-C.

Some more blog entries on the subject: