Skip navigation.
 
mlRe: Objective-C and it's future
FROM : Erik Buck
DATE : Sat Jul 08 02:50:16 2006

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 ?

Related mailsAuthorDate
mlObjective-C and it's future Thomas Davie Jul 8, 01:33
mlRe: Objective-C and it's future Finlay Dobbie Jul 8, 01:46
mlRe: Objective-C and it's future Shawn Erickson Jul 8, 01:48
mlRe: Objective-C and it's future Charlton Wilbur Jul 8, 01:55
mlRe: Objective-C and it's future Thomas Davie Jul 8, 02:10
mlRe: Objective-C and it's future Robert Walker Jul 8, 02:12
mlRe: Re: Objective-C and it's future Shawn Erickson Jul 8, 02:22
mlRe: Objective-C and it's future Rob Ross Jul 8, 02:29
mlRe: Re: Objective-C and it's future Shawn Erickson Jul 8, 02:41
mlRe: Objective-C and it's future Thomas Davie Jul 8, 02:42
mlRe: Objective-C and it's future Erik Buck Jul 8, 02:50
mlRe: Objective-C and it's future Kenny Leung Jul 8, 02:57
mlRe: Objective-C and it's future Gregory Weston Jul 8, 03:00
mlRe: Objective-C and it's future Damien Sorresso Jul 8, 03:00
mlRe: Objective-C and it's future Damien Sorresso Jul 8, 03:00
mlRe: Re: Objective-C and it's future Shawn Erickson Jul 8, 03:07
mlRe: Objective-C and it's future Thomas Davie Jul 8, 03:12
mlRe: Objective-C and it's future Damien Sorresso Jul 8, 03:14
mlRe: Objective-C and it's future Rob Ross Jul 8, 03:15
mlRe: Objective-C and it's future Rob Ross Jul 8, 03:18
mlRe: Re: Objective-C and it's future Shawn Erickson Jul 8, 03:23
mlRe: Re: Objective-C and it's future Shawn Erickson Jul 8, 03:25
mlRe: Objective-C and it's future Thomas Davie Jul 8, 03:28
mlRe: Objective-C and it's future Thomas Davie Jul 8, 03:40
mlRe: Objective-C and it's future Sherm Pendley Jul 8, 03:54
mlRe: Objective-C and it's future Kenny Leung Jul 8, 03:56
mlRe: Objective-C and it's future Shawn Erickson Jul 8, 04:22
ml[Moderator] Re: Objective-C and it's future cocoa-dev-admins Jul 8, 04:56
mlRe: Objective-C and it's future Thomas Davie Jul 8, 13:10
mlRe: Objective-C and it's future listposter Jul 8, 17:02
mlRe: Objective-C and it's future cocoa-dev-admins Jul 8, 17:05
mlRe: Objective-C and it's future John C. Randolph Jul 8, 18:50
mlRe: Objective-C and it's future Ryan Stevens Jul 8, 19:13
mlRe: Objective-C and it's future Scott Thompson Jul 10, 16:21
mlRe: Objective-C and it's future Andrew Satori Jul 10, 16:43
ml[Modertator] Re: Objective-C and it's future cocoa-dev-admins Jul 10, 17:13