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: ObjC vs Java -- NEWBIE



> 1. If I code my Cocoa app using Java, how much slower than Objective-C
> will Java be?

According to Apple, the Cocoa Java bridge is toll-free. There isn't a
huge speed difference, in my experiences. You can use Xcode to build a
few examples (for instance, Sketch and TextEdit under
/Developer/Examples/AppKit/ are implemented in both ObjC and Java) and
find out yourself.

> 2. For the .NET WebService access, which is better, Java or ObjC?

No idea about .NET anything, but I would imagine Java will give you
more features - most Cocoa classes are available for both ObjC and Java
but none of the native Java classes can be used with ObjC.

> 3. For XML parsing, which is better, Java or ObjC?

NSXMLParser is ObjC only, and appears fairly powerful and easy to use.

>
> 4. Each time I have installed an app on my new PowerBook, I've had to
> copy one object (I think it's a "bundle") from a drive image to my
> Applications directory. I think this is a great install process. If I
> code my app using Java, will I be able to use this type of install
> method when my app is distributed?

Application bundle works with any language.

>
> 5. Java apps on Windows are ugly. If I code my app in Java, will the
> user know that it's Java when it's running?

Pure Java looks slightly different from native OS X app, but Cocoa Java
looks and feels same as Cocoa ObjC, except the extra overhead of
loading JVM.

>
> 6. The few lines of Objective-C that I have seen has no resemblance to
> any language that I'm familiar with. Considering I will be developing
> on a Mac and M$ platform for years, is there any major benefit to
> learning Objective-C?

The only difference is the very superficial message passing syntax when
dealing with ObjC object, which shouldn't take you a few moments to
learn. Otherwise, the language is really just a superset of both C and
C++, so that you can use external C/C++ functions / classes and even
mix them within the same file, without bothering with things like JNI.

For long term, it's definitely worth to learn ObjC. For one thing,
code completion in Xcode doesn't work with Java (yet). Despite the
wonder of Cocoa Java bridge, there are still things easily done with
ObjC but difficult or impossible with Java or any other language,
simply because nothing is as dynamic as ObjC. The combination of
Interface Builder and Cocoa is truly in its own league, and you have to
know ObjC to fully appreciate its power.

By the way, download the PDF books of ObjC / AppKit / Foundation / etc,
and make good use of live search in Pather Preview.

Enjoy!

Bao C. Li
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



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.