News for hackers. Stuff that matters.
Re:Objective-C's niche: why it survives in a world of altern... by petercooper on Monday October 12, 2009 @09:40AM (#876668)
This is a nice look over some of Objective C's plus points, but the underlying answer to the question posed is less positive. Why does Objective C survive in a world of alternatives? Because Apple makes it tough not to use it.
Re:Objective-C's niche: why it survives in a world of altern... by Tamerlin on Monday October 12, 2009 @01:42PM (#877236)
IMO it's more like C# and .NET than that Apple is making it tough to not use Objective-C.

First look at .NET... there are a lot of .NET developers who think of .NET and C# development as the same... but there are also .NET developers using Ruby, VB#, F#, C++ .NET, and a growing number of scripting languages.

What I've seen of the Cocoa environment isn't Apple restricting developers from using languages other than Objective-C, but rather that Apple is putting its own efforts into Objective-C.

I would agree that Apple seems to be making Java hard to choose for programming the mac lately, but I'd call that progress, and therefore a positive, not a negative ;)

Re:Objective-C's niche: why it survives in a world of altern... by protomyth on Monday October 12, 2009 @05:14PM (#877663)
Apple, for a while, tried pretty hard to make Java a first class citizen of the Cocoa framework, but it just was a bad fit. Non-dynamic languages don't really do well with dynamic frameworks.

It is interesting that the drop in love for Java occurred around the same time that Carbon was shown the door.

Re:Objective-C's niche: why it survives in a world of altern... by Tamerlin on Tuesday October 13, 2009 @11:36AM (#879288)
I guess they gave up on fighting that uphill battle, eh?

:D

It's no loss... it's just Java. Old... creaky... and why are we still using it again? (Oh, right -- for the progress-averse developers.)

Re:Objective-C's niche: why it survives in a world of altern... by yan on Monday October 12, 2009 @11:40AM (#876935)
> Because Apple makes it tough not to use it

That's not very accurate. Apple has gone out of their way more so than other companies in giving you options. Apple has always provided the Java bridge for their entire Cocoa API which exposed all of its functionality to the JVM. Apple also ships Python and Ruby bindings and provides documentation and sample code on how to use them.

I have limited experience with all those bindings, but I choose to use Obj-C. In my humble opinion, it's an excellently-designed language that mixes low and high level concepts with great success.

Re:Objective-C's niche: why it survives in a world of altern... by ohhmaagawd on Monday October 12, 2009 @12:03PM (#877006)
jvm support has been deprecated. other language options are 2nd thoughts.
Re:Objective-C's niche: why it survives in a world of altern... by steveklabnik on Monday October 12, 2009 @01:25PM (#877203)
I don't think MacRuby is really a second thought. I mean, I haven't personally done anything with it, as I like Objective C as well as Ruby, but I've only heard that the integration is absolutely stellar.
Re:Objective-C's niche: why it survives in a world of altern... by tumult on Tuesday October 13, 2009 @12:33AM (#878351)
He's talking about RubyCocoa, which is what OS X comes with, not MacRuby. RubyCocoa uses the Objective-C/Cocoa object bridge, to allow Ruby to talk to Cocoa objects and send messages.

MacRuby is a different beast. It compiles with LLVM, is not bridged, and therefore works directly with Obj-C/Cocoa.

(Though, honestly, the bridged languages are really pretty good, too. Obj-C bridging is good in general. MacRuby is just sensational.)

Re:Objective-C's niche: why it survives in a world of altern... by steveklabnik on Tuesday October 13, 2009 @09:43AM (#879005)
Ah, thanks. It's funny, I love Apple, and I love Ruby, but I've yet to code Ruby on a Mac.
Re:Objective-C's niche: why it survives in a world of altern... by yan on Monday October 12, 2009 @12:05PM (#877016)
It's deprecated for a reason -- hardly anyone's been using it.
Re:Objective-C's niche: why it survives in a world of altern... by henriklied on Monday October 12, 2009 @03:03PM (#877401)
But you still can't write PyObjC for the iPhone, right?
Re:Objective-C's niche: why it survives in a world of altern... by StrawberryFrog on Monday October 12, 2009 @11:25AM (#876898)
Sure apple promotes Objective C. But that just raises the question: What does Apple see in Objective C? What is its merit to Apple?
Re:Objective-C's niche: why it survives in a world of altern... by ams6110 on Monday October 12, 2009 @09:55PM (#878120)
Well big chunks of the code base that they bought from NeXT were Obj-C. So there's the legacy issue. And as protomyth said, in the early days of OS X they really tried to convert people to Java but few developers got on board with it. Maybe because most people writing Cocoa apps in the early days were former NEXTSTEP developers and they used what they knew. Using Java to write Cocoa apps probably felt a bit like using COBOL to write .NET apps. You can do it, but it's probably not too fun.
Re:Objective-C's niche: why it survives in a world of altern... by malkia on Monday October 12, 2009 @10:31AM (#876759)
If you are talking about Cocoa (NextSTEP, OpenStep, etc.) being exposed to other languages - then it actually happened - in JAVA in WebObjects, but it was found that was not easy to use, as it was in Objective-C.

I think Apple have found their middle ground with Objective-C - you can really separate the designer/programmer jobs - one creating the Interface, the other programming it.

With Visual Studio, as soon as you double click on the button you are in the code. Some people (me) prefer that, because I'm in a position where I have to design/code myself most of the time, and it seems easier, but over the time, it looks like that's the only easy thing, as soon as your interface grows more complex, then it seems easier to describe most of the connections in IB, rather than your code.

Re:Objective-C's niche: why it survives in a world of altern... by jpcx01 on Monday October 12, 2009 @01:29PM (#877213)
Thats a good point. The switch from Objective-C to Java in WebObjects destroyed it. Maybe it would have died anyways, but it was definitely the final nail in the coffin as all the best WebObjects developers stuck with version 4.5 instead of upgrading to 5.0 (the java one).

Internally, I've heard Apple uses WebObjects 4.5 for their stores, mobileme, and other web projects.

Re:Objective-C's niche: why it survives in a world of altern... by jimbokun on Monday October 12, 2009 @05:04PM (#877648)
I think they've finally switched to the Java version across the board (from an Apple employee friend of mine) but it took a long time to get there.
Re:Objective-C's niche: why it survives in a world of altern... by Davertron on Monday October 12, 2009 @12:56PM (#877133)
You seem to be talking about XCode and the interface designer, not Objective-C; as far as I can tell, there's no reason they couldn't have nice tools and use another language besides Objective-C (I'm not advocating for that, just stating a point).
Re:Objective-C's niche: why it survives in a world of altern... by acangiano on Monday October 12, 2009 @10:54AM (#876810)
Luckily, thanks to the efforts of a Belgian "chocolatier", MacRuby has a serious shot at changing this.
Re:Objective-C's niche: why it survives in a world of altern... by jpcx01 on Monday October 12, 2009 @01:26PM (#877208)
Holding out great hope! Still learning Objective-C and Cocoa for iPhone development, however as soon as MacRuby surfaces, I'll be switching to it in a heartbeat :-)