• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective-C and it's future
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and it's future


  • Subject: Re: Objective-C and it's future
  • From: Erik Buck <email@hidden>
  • Date: Fri, 7 Jul 2006 20:50:16 -0400

The key and absolute central feature of Objective-C is that you can send any message to any object any time. This is sometimes called "Duck" typing. (http://en.wikipedia.org/wiki/Duck_typing) There is a very nice article on typing systems including a large comparison table at http://en.wikipedia.org/wiki/ Dynamic_typing#Static_and_dynamic_type_checking_in_practice.
Static/strong typing would presumably tell you at compile time or possibly even at run-time that you can't send some messages to some objects thus violating the key/central feature of the language.


Consider the following features of Cocoa and other frameworks that explicitly rely on being able to send any message to any object any time: (features in no particular order)

1) Distributed objects: Ref NSProxy and message forwarding
2) CoreData: Ref "faulting"
3) Key/Value/(Coding|Observing)
4) Target/Action and the Responder Chain: Ref -sendAction:to:from:
5) Anyplace you encounter the id data type
6) -makeObjectsPerformSelector:withObject:
7) F-Script: Ref http://www.fscript.org/
8) Cocoa's undo system
9) Simple or implicit implementation GOF Design Patterns: Ref http:// home.earthlink.net/~huston2/dp/patterns.html


Feel free to "improve" Objective-C, but I doubt anyone would call your new language Objective-C. If you appreciate the strengths of Cocoa and other Objective-C frameworks and/or the body of Smalltalk in the world, please recognize that the improvements you suggest would make the frameworks impossible or unwieldy to build in the first place.

One such example is the NSArray foundation class.  I would like to be
able to express that I specifically have an NSArray containing only
objects of a certain type.  This would allow me to (a) let the

Just out of curiosity, why do you want this ? How often do you put the wrong kind of object in a collection in practice ? What determines "wrong" ? Do you have some objection to - respondsToSelector: in cases when you can't know in advance what objects might be in a collection that was provided to your code ?




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Objective-C and it's future
      • From: Kenny Leung <email@hidden>
  • Prev by Date: Re: Objective-C and it's future
  • Next by Date: Re: Objective-C and it's future
  • Previous by thread: Re: Objective-C and it's future
  • Next by thread: Re: Objective-C and it's future
  • Index(es):
    • Date
    • Thread