Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C-- and multiple inheritance [OT]



At 9:32 PM +0100 2/27/02, Thomas Engelmeier wrote:
And the whole point of Obj-C is the (compiler supported) addition of a COM dispatch table,

You keep saying this, and it's not true. COM is nothing more than a standardized C++ virtual function table format on Windows. QueryInterface doesn't buy you the kind of dynamism Objective-C includes natively. Also, Objective-C existed well before COM did.

In Objective-C, when you send a message to an object, it gets resolved at run time.

In C++, even virtual function calls are mostly static; they're just a double-indirect through a table rather than a straight jump. And the offset into the virtual function table is recorded at compile time, not determined at run time.

bizarre semantics for some compiler - supported reflection API,

In a true object-oriented language -- one that's built on dynamic messaging -- there's nothing at all "bizarre" about being able to ask an object whether it responds to a particular message. Also, again, it happens at run time, not compile time. Though all of a class's metadata is recorded by the compiler at compile time so the run time system has that information available. (Unlike C++, where most of it is either thrown out or unrecoverable through any standard mechanism.)

and some beneficial coding conventions, so what? It requires more to effort write but is also possible in C++.

It's not really possible in Standard C++. To get these features in C++, you need to (1) enhance the language, (2) rely on implementation details of your compiler and operating system such as name mangling algorithms and dynamic loading APIs, or (3) restrict yourself to only using dynamic features with objects whose classes descend from your DynamicObject class. (And that class will not only have to do a lot of work, but all the subclass implementors will as well, to create "message maps" and the like.)

I normally can't stand it when people say "If you only understood it, you'd like it." I'll try not to say that to anyone here. But at the same time, it appears that some of the vocal critics of Objective-C *don't* really understand it. Please, learn the language and try working with it a little bit before criticizing it as "disgusting," "inappropriate for anything but rapid prototyping" (which is absolutely *not* the case), "bizarre," etc.

-- Chris

--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Objective C-- and multiple inheritance [OT] (From: Andrew Pinski <email@hidden>)
 >Re: Objective C-- and multiple inheritance [OT] (From: Thomas Engelmeier <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.