Veteran Member
Join Date: Jan 2005
|
What are the pros and cons of developing with either of these on the Mac? It seems to me that unless there is a huge performance hit, Java serves as the cross-platform lingua franca these days. I'm just wondering for those of us who don't work for Apple or write Mac OS X specific applications, especially with the looming Intel change, are there any reasons for Cocoa programming or learning Objective-C? Comments appreciated.
|
quote |
Member
Join Date: Nov 2004
Location: Planet Earth
|
I think your question needs to be a bit more specific .. but here goes with an answer:
Well the first thing is that you can't develop Cocoa applications with Java - it's been officially dropped as a supported language. Cocoa is a set of frameworks (and related tools such as Interface builder) that can let you build applications rapidly. Technologies like Core Data are based on advanced technologies like EOF; Java has similar equivalents like Hibernate; but it's not part of the J2SE specification. Building native-appearance apps with Java isn't that easy. If you need to build desktop applications fast for the Mac; and you want a first-class citizen native interface as well as access to OS X technologies (Quicktime, Core Image, Core Data, Spotlight), then you really have little choice but to use Cocoa. Java (IMO) is better suited for server side applications (like web application servers) then for desktop apps. Yonah was the biblical prophet who got swallowed by a whale. Great name Intel! |
quote |
‽
|
The verdict is rather simple really, with over 2 million results for Java sucks and only about 32,000 for Objective-C sucks. IOW, the difference is: they both suck, but one less so.
SCNR. |
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
SCNR?
Of course, the fact that practically no one outside of Mac OS X developers uses Objective-C would taint your results, chucker. Quote:
The biggest advantage for Java is it runs (generally) anywhere. The second biggest advantage for Java is that is has a HUGE library of existing classes. The biggest disadvantage for Java is that it's slow. The second biggest disadvantage for Java is that it's more difficult to manipulate memory directly. I don't have enough experience with Objective-C to make a judgement call there. The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
|
quote |
Veteran Member
Join Date: Mar 2005
Location: Near Indianapolis
|
Quote:
SCNR = Sorry, Could Not Resist |
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Yeah, I Googled it, but I was hoping someone would have some more witty response to it. Something like:
Stressed Crabs Never Rest Strange Communists Nuked Russia See? Can't Negotiate with a Republican Stupid, Crazy, Nonsensical, and Ridiculous Slap Children, Not Royalty Something Cold Nudged my Rib The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
‽
|
Quote:
Quote:
|
||
quote |
Veteran Member
Join Date: May 2004
|
Quote:
Obviously, Obj-C is teh w1n! Huh, I really would have that it would be much higher for C++. *shrug* The issue with Obj-C outside of the Mac isn't the language - gcc has native support for Obj-C by default in the normal distros. It's that *Cocoa* is what people use, Obj-C is just sort of a byproduct of that decision, and Cocoa isn't anywhere else. GNUStep is getting there, but it's still kind of primitive in many ways. Okay, a lot of ways. (But at only 15k hits for 'gnustep sucks', apparently it's better than even Obj-C. ) But, all that being said, Obj-C is up there with Smalltalk in my personal shrine to programming languages. |
|
quote |
Veteran Member
Join Date: Jan 2005
|
To sum up, it would seem that it's only useful to learn Objective-C if you're going to use Cocoa and write OS X-only applications. If anyone else has a different opinion, speak now or forever hold your piece (sic).
|
quote |
Veteran Member
Join Date: May 2004
|
Or unless you want to learn how to grok OO really well. Only Smalltalk is really better for that. C++? Pah. Bastard child. Java? Feh. Developmentally slow child. Go for the gold standard, learn Smalltalk... or, if you want to actually do something fun with it, learn Obj-C.
Remember, languages come and go, but the basic principles are forever. Well, except FORTRAN. We're still dealing with that albatross. |
quote |
‽
|
Well, there's various bindings to write Cocoa code, such as RubyCocoa.
|
quote |
Veteran Member
Join Date: May 2004
|
Indeed, and the Python-Cocoa binding, PyCocoa, is *great*.
I <3 Python. |
quote |
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
Quote:
And a lot of the buzzword technologies that surround Java? Also seems like a huge mess. I test J2EE apps that run on WebSphere. It drives me absolutely nuts. Maybe I'm a tad biased, but still... I like these other languages because they don't force an enormous set of libraries on anyone; a given user has only the libraries s/he needs. Particularly Python and Ruby I find interesting because they're two of the other truly Object-oriented languages (where everything is an Object, versus C++ where that's not always true). Thus my anti-Java bias makes me vote for Objective-C. Apparently I call the cops when I see people litter. |
|
quote |
Not a tame lion...
Join Date: May 2004
Location: Narnia
|
I use java for writing programs and I enjoy it.
I like the wealth of help available for java and I like the java API after you learn to navigate the spec, it is ridiculously easy to find a class that does what you want it to and a sometimes tutorial to go with it. I don't have any problem with the speed of java. Little slowdowns here and there can be sorted out by refining your code. I havn't tried Objective C yet, but I will someday. It just seems like a waste to me, to write a program that can only work on one platform. If I write a program with C or java, it can at least be compiled on another OS or architechure, with possibly a little debugging. If I write a cocoa program, well it's mac only, and the code will not be reusable. I can see using Objective C / Cocoa for apps that depend on a technology only present in OS X. But for an app that doesn't access any technologies integrated into the operating system, IMHO, java is a better choice. |
quote |
Veteran Member
Join Date: May 2004
|
Quote:
If your app doesn't access any technologies in the OS, then you're free to use ANY language, not just language du jour. In that case, why not use the language that is nicest? Seriously, think about your argument... if you're writing for the Mac, then you're using the OS. If you're writing to Windows, then you're using the OS. If you're writing to KDE or Gnome, then you're using 'the OS'. The only time you *WON'T* be using technologies provided for you, is when you write everything from scratch yourself, in which case you have complete freedom to choose the language. In such cases, going with the herd is about the dumbest thing you could do. Now what I *think* you meant to say was something along the lines of "If your app isn't using any SPECIFIC technologies that are wedded to THAT platform, then use a cross-platform set of libraries." The languages are all cross-platform - Obj-C compiles just spiffy on any machine gcc installs on, as does C, C++ or Java. |
|
quote |
Not a tame lion...
Join Date: May 2004
Location: Narnia
|
Quote:
As for Obj-C, isn't cocoa the only decent API? I saw the screenshots from Gnustep, and I dont think it's quite there yet. |
|
quote |
Veteran Member
Join Date: May 2004
|
Pretty much, yeah. If you're going to use Obj-C, Cocoa is heads and shoulders above anything else... then again, I happen to think it's heads and shoulders above most other solutions for any language.
You have to consider though, that most custom apps are written in a very crude way, and that the cost effectiveness of buying more hardware to make the code development (and above all MAINTENANCE) more efficient is a no-brainer... but one that people seem to balk at. Silly people. |
quote |
Veteran Member
Join Date: Jan 2005
|
Quote:
True, the gcc compiler could be used to create "cross-platform" programs, but it is not optimized for each platform. For example, if you want to make the fastest C program on an Intel processor, you wouldn't use the gcc compiler, you'd use Borland or Visual C++. Quote:
|
||
quote |
Veteran Member
Join Date: May 2004
|
Which is, I'm sorry, idiotic. You use the language that's best suited for the task, or you're just wasting your company's money.
It's not an academic exercise, it's how the real world works once you get past the Java=kewl level. Get some experience in industry, and you'll find that there are the most *bizarre* languages out there, finely tuned for particular needs. Quick, what's the language that still has the most functioning and currently maintained lines of code? |
quote |
Veteran Member
Join Date: Jan 2005
|
Cobol?
|
quote |
Not a tame lion...
Join Date: May 2004
Location: Narnia
|
Quote:
It's like we are second class citizens of geekdom... |
|
quote |
Veteran Member
Join Date: May 2004
|
Quote:
And yes, it's COBOL. Latest estimate I saw had over 70 *BILLION* lines of code. C is second, C++ or Java distantly behind. I think FORTRAN still has the edge over Java, actually. The point is that there are a lot more languages out there that you need to consider to do your company and your project justice. Many times, C++, Java, C# etc, will be just fine - but you have to know when to break free of the herd. Heck, want to know what company ruled the Fortune 100 custom-app roost from 1988-1996? NeXT. Companies bought closed proprietary hardware at several times the cost of x86 boxes for their own internal custom apps. Why? Because the development and maintenance costs were orders of magnitude lower. Custom apps, not commercial shrink-wrap apps, still comprise the vast majority of the software systems in existence. Fun Fact: Guess how much of the total cost of the average software system's total cost, from idea to termination of the project, is spent getting 1.0 out the door? Think of all the blood, sweat and tears that go into getting a product shipped for the first time. Try 15%. 85% of the total cost is just maintenance. Anything you can do to help alleviate that will *swamp* the cost buying new computers or even training folks on a new language or library, if those solutions are that much better. And at 85%, you don't have to be *vastly* better, just incrementally. If you want to make yourself employable, learn programming language theory, not programming languages. You'll be able to jump from solution to solution effortlessly, and learn a new language in a few hours. My first Python app, after spending about a day learning the ropes, is now about 55,000 lines. Same design, same architecture, same basic algorithms. Last edited by Kickaha : 2005-11-16 at 01:39. |
|
quote |
‽
|
Quote:
|
|
quote |
Not a tame lion...
Join Date: May 2004
Location: Narnia
|
You are of course correct, programming theory will get you a lot further than knowledge of a specific language.
But the thread is "Objective-C vs. Java" so I was arguing my case for java. Although I took offense to your comment, don't worry about it, I'm over it that being said, I often see derogatory comments online about java programmers, perhaps it's because many "java programmers" are new to the fold and their code is poorly written (from a lack of experience no doubt) which is further exacerbated by the JVM which historically has had poor performance. I'm not sure if you've read this article or not but it was on slashdot a few weeks ago, it's about the industry wide dumbing down of programmers. I enjoyed the article. Does Visual Studio rot the mind ? |
quote |
Veteran Member
Join Date: May 2004
|
*twitch* Oh dear god, I'm with the author, IntelliSense is evil incarnate.
Unit testing? Forget it. You can't write the test before the code. He's absolutely right, it enforces a particular way of coding, and worse, of *thinking*... in the small. Tiny little details instead of the larger issues and concepts, the *abstractions* you *should* be thinking about. Maybe Windows will finally collapse under its own stupidity now. To be honest, I think the smackdowns against Java programmers you see are mostly because new programmers run across Java and think it's the KEWLEST TH!NG EVAH and the proceed to try and convert everyone else... when the rest of us have been there, done that, and moved on already. (You have no idea how tired I got of pointing out to zealots of the bytecode system that they were just UCSD P-codes resurrected. Those were in, um, 1974? Not. New.) Java is a good little language. I like the language, for the most part, even though I think they made some bad decisions here and there. Or, at least, questionable ones. I'm not overly fond of the libraries, since they were modeled after NeXTstep, but didn't have the advantage of a richly dynamic underlying language, so some *ahem* compromises were made. Overall though, the libraries are livable. The *BYTECODES* however... Gosling & Co should be strung up, shot, drawn and quartered, buggered fatally by camels, and boiled in greasy geek hair oil for those. They should have stuck with the original vision for those: toasters. (No, I'm not kidding. Look up Project Oak sometime.) |
quote |
Member
Join Date: Jun 2005
Location: United Chavdom of Little Britain
|
I found Obj-C's syntax to be rather confusing compared to Java's. But that might be because I went from C -> a little C++ -> Java.
Dr. Kickaha, please could you pass on your views about Unit testing to my Lecturers? I'm fed up of this stupid buzzword filled eXtreme Programming crap :-( And before I forget... 10 PRINT "BASIC is teh r00lz!!!" 20 GOTO 10 "It's like a new pair of underwear. At first it's constrictive, but after a while it becomes a part of you." |
quote |
Veteran Member
Join Date: Jan 2005
|
One question nobody has really answered is how do Obj-C and Java compare in performance on the Mac? On PC's Java used to be much slower than C, for example, but now the performance difference is not that great (~5-10% I have heard). Is it more than that on OS X?
|
quote |
Veteran Member
Join Date: May 2004
|
Quote:
But it is quite a bit different looking to the novice. Quote:
Like any tool though, it can be overused, and you'll see folks touting them as the latest silver bullet. Quote:
10 POKE(RND(255) * 16384, RND(254) * 255) 20 GOTO 10 |
|||
quote |
Banging the Bottom End
Join Date: Jun 2004
|
Quote:
10 FOR X = 16384 TO 32768 20 POKE (X, DATA) 30 NEXT X 40 DATA 234, 120, 149, 123, 362, ... 50 DATA ... and on and on, basically POKEing an ASM program into memory, then passing control to location 16384. Talk about debugging fun too! |
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Java is messed up! | Mommy8me | Genius Bar | 0 | 2005-11-11 10:42 |
Java Applets not Loading | pmazer | Genius Bar | 2 | 2005-09-27 12:42 |
iBook or PB for Java Development | bearclaw79 | Purchasing Advice | 7 | 2005-09-20 21:25 |
Get your Java updates! Only 45 mb. | Quagmire | Apple Products | 31 | 2005-09-15 19:46 |
Java 1.5 - finally | ghoti | Apple Products | 1 | 2005-05-08 08:20 |