[Pyobjc-dev] memory management.
Brought to you by:
ronaldoussoren
From: Jonathan L. <pan...@sk...> - 2002-10-28 05:35:34
|
Guys, I have been watching the discussion on retain/release/autorelease semantics for a few days and I have put some thought into things. After a lot of thought, I would like to sincerely urge you to make an attempt at abstracting out any and all retain/release/autorelease responsibilities for the programmer. I understand the argument that it isn't very "Cocoa-like", but I feel that I have a compelling argument here. First, I believe that you alienate most python programmers by enforcing memory management on them. Python programmers use python *because* they don't have to worry about this kind of thing. Its not that they don't know how or are afraid of it, they just don't want to touch it. If you force people into it, they will likely end up using wxPython or something like REALBasic. Secondly, to counter the "Cocoa-like" argument, placing memory management functionality into a python product is simply not "Python-like". Sure, it will feel more like developing with Cocoa and Objective-C, but people are going to use the Python bridge because they don't want to work with Objective-C when they don't have to. You have to make a choice here... if PyObjC is for Cocoa developers who don't know python, then certainly you should try and be "Cocoa-like." But if PyObjC is for *python programmers* (which I have a feeling it is), then it should strive to be Python like... meaning no retain/release at all! My last point is that I believe this project is a unique opportunity to take the already simple and powerful Cocoa development frameworks and make them even more elegant. Python has a powerful ability to help developers implement or prototype things QUICKLY. Memory management through old-style reference counting stands directly opposite to this power. If you lose this, why use Python at all? You might as well just use Objective-C (it only takes a few minutes to learn) and is faster than python. When I switched to Mac OS X a few months ago, I had been using Java Swing, wxPython, and GNOME's Python bindings to build GUI applications. On OS X, I really wanted to be able to leverage the native widgets and native frameworks to their fullest potential using a language that I was comfortable with. I tried out the Java bridge and was terribly disappointed with speed, documentation, and general instability of the bridge. Then I bit the bullet and learned Objective-C. I was impressed overall, but really felt that the memory management system was pathetically outdated and cumbersome. Its certainly better than C, but definitely not as simple as my previous solutions. When this project came along I was extremely excited about the possibilities that it offered. Please consider at least making an automated system an OPTION. I know its hard, but I think that in the long run it will be worth it. A system like Cocoa without manual memory management using a language like Python and Mac OS X's developer tools is such a powerful concept and could truly be the "killer app" of development on Mac OS X. Just some food for thought... - Jonathan |