Apple Drops The Cocoa-Java Bridge


idea_hamster

macrumors 65816
Jul 11, 2003
1,096
1
NYC, or thereabouts
I know zip about programming, but...

This doesn't really sound like it could be positive.

To the ignorant, it sounds like either Apple is trying to force Java programmers to learn Obj-C (foolish, negative, unlikely) or that the number of Java programers that were taking advantage of OSX's Java compatibility was too small to justify the continued support (neutral, negative, more likely).

If it's somehow counterintuitively positive, I'd be interested to know!
 

winmacguy

macrumors 68020
Nov 8, 2003
2,237
0
New Zealand
idea_hamster said:
This doesn't really sound like it could be positive.

To the ignorant, it sounds like either Apple is trying to force Java programmers to learn Obj-C (foolish, negative, unlikely) or that the number of Java programers that were taking advantage of OSX's Java compatibility was too small to justify the continued support (neutral, negative, more likely).

If it's somehow counterintuitively positive, I'd be interested to know!
here are a few comments from OSNews.com where I got the article from
"If your going to use a toolkit like cocoa that ties you to the Mac platform (GNUstep aside), why use java."

"Because Java is a nicer langauge to work with than Objective-C. No worries about pointer troubles, memory management or endianess issues. Also, having a choice between several languages is always a good thing.

Apple goes the Microsoft way more and more. It's more and more "our way or the high way".

They should listen a bit more to what the developers say, after all, those people are the ones who create the apps where Apple eventually lives from, because no apps is bye bye osx.

I'm a Mac user, and a Linux user. More and more, I like the openess from Linux over the "ease of use" of a Mac. Mac is only friendly to the ones they like. For instance, after all these years, there's still no decent support for Nokia phones in their iSync."
 

ppc_michael

Guest
Apr 26, 2005
1,498
2
Los Angeles, CA
As a developer, I'm fine with this. My experience has been that Java produces slow, unstable programs when used with Cocoa. Java has never been easily "bridged" anyway.

Perhaps they've been having trouble with Rosetta + Java? Or maybe not. ;)
 

idea_hamster

macrumors 65816
Jul 11, 2003
1,096
1
NYC, or thereabouts
Hmmm...maybe I have been working on a false premise.

Somewhere in the back of my dino-brain, I had the thought that Java was a cross-platform language. Is that the case? Or is Java-for-Mac substantially unusable on other platforms?
 

Jedda

macrumors regular
Nov 19, 2003
126
0
I think it's a double edged sword.

Java & Cocoa have never worked together splendiferously anyway.

Hopefully Java developers will be willing to make the switch to Obj-C. It's a fantastic language, far better than java in my opinion (especially for OSX development) and really is the only road to future development on OSX.
 

Nermal

Moderator
Staff member
Dec 7, 2002
18,678
1,183
New Zealand
Cocoa-Java is basically Java (all platforms) linked to Cocoa (Mac only). So Cocoa-Java isn't very usable on other platforms.

NB: I'm not a Mac developer.
 

iMeowbot

macrumors G3
Aug 30, 2003
8,643
0
winmacguy said:
here are a few comments from OSNews.com where I got the article from
"If your going to use a toolkit like cocoa that ties you to the Mac platform (GNUstep aside), why use java."

"Because Java is a nicer langauge to work with than Objective-C. No worries about pointer troubles, memory management or endianess issues. Also, having a choice between several languages is always a good thing.

Apple goes the Microsoft way more and more. It's more and more "our way or the high way".
Apple are really doing the opposite of that, pushing Java coders toward sticking to standard Java instead of hooking into proprietary Apple extensions. People can still dork around with things like JNI if they really want to break things.
 

RacerX

macrumors 65832
Aug 2, 2004
1,504
2
The first mixing of Java in with Objective C was done back in the OPENSTEP days with the release of the first version of WebObjects as I recall.

After Apple bought NeXT they decided to integrate Java with OpenStep to create Yellow Box. And Apple used TextEdit to demonstrate that Java could be used as the foundation of an application in Yellow Box.

Well, the Java version of TextEdit wasn't that big a hit. In fact, it was deemed so annoying by some that a developer actually reverse engineered TextEdit to create an Objective C version (which is actually the version that I use in Rhapsody).

Further, when Apple said that it was dropping Objective C from WebObjects following 4.5.x the community got rather upset with Apple.

As for the success or failure of Java as a Cocoa development language, I haven't really seen many Java based apps. Off hand I can only think of one Java based app (NeoOffice) and it wasn't really a Cocoa app anyways.

Honestly, the advantages of Java in Cocoa were lost when Apple pulled the plug on Yellow Box for Windows. Java is best suited for being cross-platform, and would have been great for creating apps that could have run on both Macs and Windows PCs (with a Cocoa application environment installed).

As it stands now, Objective C is the best way to take advantage of Mac OS X and trying to support features for both Objective C and Java was most likely costing Apple more than it was worth.

As for the loss of features looking into the future, I'm not sure that any of the Java projects that I'm aware of would notice this anyways. So I doubt that this is all that big a set back for anyone.

I'm not sure it amounts to a net positive or negative... just a change.
 

freiheit

macrumors 6502a
Jul 20, 2004
643
90
California
One more thing to note is the document mentioned that "new" features added to Cocoa would not be added for Java. This would seem to indicate that existing support will remain so existing Java-Cocoa applications will continue to run into the foreseeable future. And since the next version of OSX isn't expected until the end of 2006 or early 2007, there's still quite a bit of time for developers to continue making use of Java-Cocoa and still be compatible with the majority of OSX installations.
 

Flying Llama

macrumors 6502a
Aug 4, 2004
737
0
Los Angeles
I have always hated cocoa-java apps. Even as a non-programmer I could tell the difference, and it really bugged me. I see this as quite positive.

llama :eek:
 

mj_1903

macrumors 6502a
Feb 3, 2003
563
0
Sydney, Australia
It's a blessing and a curse in that some people will be inconvenienced but Apple will have more developer time for the frameworks.

I have yet to get much of a reaction from the community yet but I am sure to here it soon.
 

Neuro

macrumors regular
Jun 15, 2003
209
2
London
I just wish Apple would come up with something more accessible / modern than Objective-C. C# is so much easier to get into and just makes more sense to me.
 

recursivejon

macrumors regular
Jul 6, 2004
176
0
New York
Jedda said:
Hopefully Java developers will be willing to make the switch to Obj-C. It's a fantastic language, far better than java in my opinion (especially for OSX development) and really is the only road to future development on OSX.
Yeah, I've been working with Objective-C for about a year now and it's my favorite language I've ever coded in. ( having worked with C, C++, PHP, and Java )

Java is just such a sketchy language in general... it bugs me. Glad to see Apple's finally made up their mind.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,559
628
Cork, Ireland.
Just wanted to offer my take on the snippet you posted..

winmacguy said:
"Because Java is a nicer langauge to work with than Objective-C.
Entirely subjective, differrent people have differing tastes.

winmacguy said:
No worries about pointer troubles,
There isn't a huge advantage, you're dealing with references instead of pointers. The fact that Cocoa "protects" you from calling a method on a nil pointer takes away much of the pain.

winmacguy said:
memory management
An often touted advantage, but I'm not sure how significant it is. The Java garbage collection won't do anything unless you remove all references on the object anyhow, which isn't much different from using ObjC/Cocoa's release method.

winmacguy said:
or endianess issues.
You're still not 'free' of endian issues, for instance if you're using a serial or virtual serial connection, you'll still need to determine & handle the byte ordering of the data coming through. That's not much different on Java or Obj-C.

winmacguy said:
Also, having a choice between several languages is always a good thing.
This, I'd definitely agree with. Choice.. gooood!
 

whooleytoo

macrumors 604
Aug 2, 2002
6,559
628
Cork, Ireland.
Nermal said:
Cocoa-Java is basically Java (all platforms) linked to Cocoa (Mac only). So Cocoa-Java isn't very usable on other platforms.

NB: I'm not a Mac developer.
However, one benefit of Java Cocoa apps is they (should!) run on Intel or PPC unmodified. Which is why it seems like an odd time to ditch the Java bridge.
 

rolley

macrumors newbie
Apr 15, 2005
4
0
Java is newer and more used than Obj-C

whooleytoo said:
Just wanted to offer my take on the snippet you posted..



Entirely subjective, differrent people have differing tastes.



There isn't a huge advantage, you're dealing with references instead of pointers. The fact that Cocoa "protects" you from calling a method on a nil pointer takes away much of the pain.



An often touted advantage, but I'm not sure how significant it is. The Java garbage collection won't do anything unless you remove all references on the object anyhow, which isn't much different from using ObjC/Cocoa's release method.



You're still not 'free' of endian issues, for instance if you're using a serial or virtual serial connection, you'll still need to determine & handle the byte ordering of the data coming through. That's not much different on Java or Obj-C.



This, I'd definitely agree with. Choice.. gooood!
As a Java developper I never managed to enjoy Obj-C. It's not about memory or pointers, but about the pleasure I have using it and how fast you can write code. Since Java is more recent, a lot of what used to be complicated in C (and its variant) was elegantly redone in Java. Then there is sooooo much more online documentation about it then there is for Obj-C, or Java coding environments. And in the end more people will be formed for programming using Java or C# then Obj-C.

I actually stopped learning Obj-C when I realize HOW COMPLICATED (about 30-60 lines of code) it was to create a new Thread that could talk back to objects in the main Thread. In Java I can create a new Thread in a single line command, and nothing fancy to do if I want this thread to access object in another thread.

Then there is the error management, or exceptions in Java. In java you get the line and the reason while in Obj-C you get incorrect memory access or some obscure message that really forces you into debugging.

All in all, I was very disappointed by Obj-C, it really felt like going back 30 years. I might give it another try sooner or later, but Apple Dropping the Java - Cocoa bridge is ditching huge amounts of potential coders for OSX.
 

macFanDave

macrumors 6502a
Apr 14, 2003
571
0
We can talk all day about the merits of Java,...

but the reality is that the vast majority of Cocoa development is being done in Objective-C. It is just not a wise use of Apple's resources to expend the effort to support a language that very few people are using, especially one that does not have all of the basic idioms that Cocoa is built on in the first place.

Personally, I think Java sucks. Just as much as C#, but less than C++. Objective-C is beautiful and the fact that it IS C is just one aspect of that beauty. You have access to decades of tried and true libraries and you have the freedom to be procedural when the need arises.

While an earlier poster mentioned that there was something complicated in ObjC that was a one-liner in Java, my colleagues and I found several cases where Java was stunningly complex and convoluted.

The whole Cocoa-Java thing always seemed to me that it was a huge kludge that was pushed on Development by the thugs in Marketing.
 

idea_hamster

macrumors 65816
Jul 11, 2003
1,096
1
NYC, or thereabouts
Interesting....

I guess one other thing that was in the back of my mind was Apple's modest support for BluRay and the new DVD standards in general. It's my understanding that the next generation of set-top high-def DVD players will support a much richer programming capability, which, as I recall, is expected to be Java.

I guess the likelihood of some high-def DVD-coding maven deciding to write his/her own app for Mac is just too remote to justify continued Java support. (Maybe "support" is the wrong word -- maybe "meta-development" is better?)
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,641
12
Grand Rapids, MI, USA
I read this article and went searching and couldn't find a straight answer to this question....

Are programs such as NeoOffice/J, DVArchive, Image/J, and others that are written as compiled (partially) Java applications in OS X written using the bridge? It seems like they might be, but then I found lots of references to AWT in the NeoOffice/J docs, so I would think that would make the answer no.....

But at any rate, will the implementation of OS X look and feel in OSS through this mechanism be impacted by this decision on Apple's part?
 

Kerry Sanders

macrumors regular
Apr 25, 2005
207
0
Hayden, AL
recursivejon said:
Yeah, I've been working with Objective-C for about a year now and it's my favorite language I've ever coded in. ( having worked with C, C++, PHP, and Java )
I got my Power Mac back in early May. Since I have been a developer for the past 16 years, I thought I would try my hand at Objective-C. I am just getting started, but so far, it seems easy to pick up. I believe anyone with a programming background could easily pick it up and run with it.
 

Cvstos

macrumors member
Nov 19, 2004
88
0
Speaking as a Java developer, I'm disappointed with this news. Apple's Interface Builder is extremely elegant, and it's a shame I won't be able to really use it for my Java apps as time goes on.
 

pubwvj

macrumors 68000
Oct 1, 2004
1,891
202
Mountains of Vermont
idea_hamster said:
Apple is trying to force Java programmers to learn Obj-C (foolish, negative, unlikely)
This is a good thing. Java steals the speed that the new processors give us. The hardware keeps getting faster but the programmers keep getting sloppier using higher and higher level languages with the result being that software still feels like a dead horse. Drop Java.
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,641
12
Grand Rapids, MI, USA
Cvstos said:
Speaking as a Java developer, I'm disappointed with this news. Apple's Interface Builder is extremely elegant, and it's a shame I won't be able to really use it for my Java apps as time goes on.
Are you talking about using their interface builder to make AWT or Swing interfaces? I don't think that's going away... I hope not, at least. :(

Pubwvj, it's true that applets that run in JVMs are slow, but that isn't quite solely because of how high-level Java is. Java itself isn't that much higher-level than the C variants, is it? If you compile two Apple binary executables, that both use Cocoa, and one is built in Java code, using the bridge, and the other in Obj-C code, how much of a speed penalty does the Java version have? I haven't tried this except in the simplest of cases, but I did not see huge performance hits in those simple cases.
 

Cvstos

macrumors member
Nov 19, 2004
88
0
Java is not that slow. On most modern machines for the majority of apps, the performance hit on a well-written app is negligible. Java is also a hell of a lot easier to work with, IMO. Stuff that took me forever in my C++ classes would've been infinitely easier if I had written them in Java. I was looking at the difference between three hours of work with Java to an entire week of work with C++.