Re: Cocoa Java vs Swing Java classes
Re: Cocoa Java vs Swing Java classes
- Subject: Re: Cocoa Java vs Swing Java classes
- From: John Timmer <email@hidden>
- Date: Sun, 14 Oct 2001 15:02:45 -0400
>
Why should I use Cocoa Java for GUI elements when I can use Swing Java
>
to achieve the same graphical effect?
As somebody who's not a full time programmer, I'll throw my two cents in:
If you're doing this full time, and don't care if your entire code base is
portable, you should probably learn ObjectiveC and get it over with. It's
faster and more of the Cocoa API's are available in it.
If your primary goal is to get the same code running on more than one
platform, stay away from Cocoa. It's OS-X only.
That said, despite its frequent denigration on this list, you can get a lot
done with Cocoa /Java. As a full time biologist, I sometimes go months
between the opportunities to sit down and do some coding. When that
happens, Java's syntax is easier for me to follow and its garbage collection
means that I have a lot less to worry about when I'm writing data analysis
programs for work.
In terms of generating a functional GUI, Cocoa/Java is vastly superior to
Swing. Two reasons stand out. One is that its performance is is a lot
better. The second is that Swing is a bit of a lowest-common-denominator.
In trying to get things to act natively on a bunch of different platforms,
Swing seems to force you to accept some of the worst features of Windows and
some of the Unix GUI's. By going through Cocoa, you get a much better API
and much more consistently behaved widgets.
This is my take after having tried relearning C so I can use Obj-C, using
Cocoa/Java, and working with the authors of a couple of Swing applications.
Jay