Hacker News new | past | comments | ask | show | jobs | submit login

I cannot agree that no garbage collection is a feature. It is just like saying poverty is a feature.

However, Apple might have good reasons taking garbage collection out of iOS. Here is my speculation. From financial and technical point of view, it is not worth to drain their manpower in writing good garbage collector and handling consequent complexity in this device. It gains no better user experience. If garbage collector goes wrong, the user experience is hellish. Everyone will blame Apple instead of application developers.

On the other hand, writing Objective-C code is not particularly hard. The key is to return memory to system as soon as possible. Once adapted to class pattern, coder is easy to manage memory because the memory alloc/release cycle is very structural. Just keep it in designated place. Also, Apple does not inhibit coders to use autorelease. And, XCode have some tools to detect possible memory leaking code.

I have worked on Adobe Flex for years. Flash player has garbage collection. But in fact, an application consumes lots of memory easily but there is no way to control it. Garbage collection is good, but only when there is a good garbage collector.

I am optimistic that some years later, garbage collector will eventually on iOS, as MacOS X now. Mobile processor and battery are expected to be more powerful.

From my experience, Apple does not really care about memory leaking of my application. (Or I never exceed their limit. Or it is hard to distinguish from other consumption.) Apple concerns more on application design and its content.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: