5 ms·
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
by petercooper 17y ago
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.
- malkia 17y agoIf 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.
- Davertron 17y agoYou 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).
- jpcx01 17y agoThats 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.
- jimbokun 17y agoI 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.
- acangiano 17y agoLuckily, thanks to the efforts of a Belgian "chocolatier", MacRuby has a serious shot at changing this.
- jpcx01 17y agoHolding 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 :-)
- StrawberryFrog 17y agoSure apple promotes Objective C. But that just raises the question: What does Apple see in Objective C? What is its merit to Apple?
- ams6110 17y agoWell 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.
- yan 17y ago> 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.
- ohhmaagawd 17y agojvm support has been deprecated. other language options are 2nd thoughts.
- yan 17y agoIt's deprecated for a reason -- hardly anyone's been using it.
- steveklabnik 17y agoI 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.
- tumult 17y agoHe'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.)
- steveklabnik 17y agoAh, thanks. It's funny, I love Apple, and I love Ruby, but I've yet to code Ruby on a Mac.
- Tamerlin 17y agoIMO 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 ;)
- protomyth 17y agoApple, 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.
- Tamerlin 17y agoI 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.)