|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
On May 20, 2008, at 10:46 AM, Bill Bumgarner wrote:
On May 20, 2008, at 1:07 AM, Peter Duniho wrote:But personally, it makes me nervous to have a language that allows the implementation of a class to change according to other code not related to the class. It's one thing if you're just adding a method that you want to use somewhere else. But in Objective-C you can also add a method that overrides a base class method, or would not normally exist in the class but which has meaning to some other code that might check for it.
I have been programming in Obj-C against the Cocoa APIs (and their predecessors) since 1989-- with quite a few other random APIs and environments over the years, too-- and I can unequivocally say that the ability to override existing functionality in categories is just damned dangerous.
When I found out about C#'s "extension methods", I wrote about it here:
And then followed up with a second post here:
In any case, you are absolutely correct that categories are dangerous and the above includes an anecdote documenting a particularly egregious related problem. Most extremely powerful tools are. Sometimes one must question whether or not said power is gratuitous or truly useful and this particular feature falls in "gratuitous".
Reminds me of this classic story:
In particular, search for "hole hawg".
Given that the Cocoa development community has obviously expanded quite substantially in recent months and many of you are coming to Cocoa with deep experience in other environments and languages, please file bugs / feature requests / feedback through Apple's bugreporter system (http://bugreport.apple.com/).
I am late with my comment - sorry.
Georg Tuparev Tuparev Technologies Klipper 13 1186 VR Amstelveen The Netherlands Mobile: +31-6-55798196
Cocoa-dev mailing list (email@hidden)
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: This email sent to email@hidden
Visit the Apple Store online or at retail locations.
Copyright © 2011 Apple Inc. All rights reserved.