Re: Java and Objective-C
Re: Java and Objective-C
- Subject: Re: Java and Objective-C
- From: Peter Duniho <email@hidden>
- Date: Sat, 7 Jun 2008 16:16:51 -0700
Date: Sat, 07 Jun 2008 12:38:14 -0700
From: Bill Bumgarner <email@hidden>
This comes up time and time again -- Why did Apple choose Objective-C
vs. Language X?
That is off topic for cocoa-dev and, thus, not a useful direction for
taking this particular conversation.
I agree. In spite of my willingness to get sucked into a tangent
like that in the past, inasmuch as Obj-C is _the_ language used with
Cocoa, it's pointless and potentially flame-baiting to question
whether it's better or worse than any other language.
That said...
I believe, however, that there is an on-topic direction within which
to frame this particular discussion that will be helpful to folks new
to the platform and educational to those that may not know, say, Java.
Specifically -- a programming question. Easily framed.
How would you implement NSUndoManager in Java?
Personally, I'm not convinced that this question is any better than
the converse. It implies that Java is inferior in some way, when
it's not.
In particular relative to this question, please refer to my previous
replies to the same question in the context of C#.
The primary difference between C# and Java is the lack of delegates
and variable capturing (here "delegates" refers to C#'s idea of
function pointers, not the "delegate" in common use within Cocoa).
But both of those effects can be easily implemented in Java, with
only slightly more awkward syntax. Delegates can be replaced by
anonymous inner types, and effects similar to variable capturing can
be had either with "final" local variables or simply by instantiating
a new object to hold the value.
As I pointed out in my other replies, implementing something like
NSUndoManager is trivial in C#. It would only be slightly more so in
Java, and only because of the above. There's really no need to
rehash the discussion; just look at the previous one, and replace the
C# idioms with their Java equivalents.
Pete
_______________________________________________
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