On May 19, 2008, at 3:26 AM, Jean-Daniel Dupas wrote:

That'd be great for the Mac, but not so great for the Cocoa evangelists. It's hard to understand the neglect Java has seen on the Mac, except as a way to try to steer more people towards Cocoa.

Cocoa is a framework, Java a language. Apple provided a Cocoa/Java bridge to let developpers choose there prefered language to use Cocoa, and bet what, almost nobody choose Java. That's why the bridge is no collapsing slowly.

Java is not just a language. It's a framework too. As for the Cocoa/ Java bridge, I had no idea it existed. If I'd known, I would have tried it.

I presume from your comment about "now collapsing slowly" that it's no longer a fully-supported technology.

That said, as I've said repeatedly now, while I have my complaints about Objective-C, that's not really what keeps Cocoa programming from being fun for me.

It's different because there no informal protocol in C#, so you have to create a interface for each optional method you want to add to your object, and then declare that you implement each interfaces in your class declaration.

Optional methods rarely appear in isolation. They represent some behavior shared by a variety of objects, and most frequently as part of a whole package.

But even so, what's so bad about having to declare an interface? In Obj-C, I wouldn't hard-code a string in my code anyway; at a minimum, I'd declare a constant that represents that string, and it's possible in some cases I'd even initialize a selector variable to store the actual selector. So it's not clear that you'd save that much typing, if any. I surely wouldn't.

And using a formal interface provides compile-time code verification that just isn't possible with the message-dispatching scheme.

I just don't see how declaring an interface and then using it is so inferior to an informal protocol that it justifies the entire message- dispatching paradigm, especially given that there are in fact advantages to the former. At best, it's a wash.

(Besides, both Java and C# support via reflection functionlity that that would allow this exact kind of informal protocol/interface approach, were it truly necessary and significantly better).

I'm sorry, but this particular example is just plain weak. I'm looking for a _compelling_ justification for the message-dispatching paradigm, not an example that saves you a line or two of code every now and then.

Pete
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to