Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would anyone care to comment on the state of Obj-C outside the Mac/iOS platforms? The impression I get from previous posts on this is that the utility of Obj-C is closely tied to the functionality provided by the (proprietary) Cocoa platform.

Since there are so many developers from outside the Apple ecosystem learning Obj-C in order to develop for iOS, is there any signs of a movement in the other direction? Are developers who don't think of themselves as purely Mac/iOS developers trying to take Obj-C back with them to other platforms?

Posts about how great or poor Obj-C is as a language are kind of irrelevant really as long as it's (effectively) the mandatory language for development on Apple platforms, and isn't much used beyond that. In that situation there are no choices to be made based on opinions about the language's merits or flaws, so they are largely moot.



As far as I am concerned, Obj-C and Cocoa are so tightly integrated into each other that using one without the other is a rather pointless exercise.

There are compilers available to use Obj-C (the language) on just about any platform. I guess you could use Obj-C to write GTK or Qt code (I doubt that the Qt preprocessor would like that, though).

If you read that Obj-C is great, that usually means that Obj-C is great for Cocoa. Cocoa and Obj-C make for a great team! Probably comparable to Android and Java or .NET and C#. It ultimately does not matter whether Obj-C would be of much use without Cocoa, since almost all people will be using it as part of Cocoa.

Great tires are of little import if you don't own a car.


I get the impression most developers use Objective-C because they have to, rather than because they want to. Take a look at the Tiobe graph for Objective-C:

http://www.tiobe.com/index.php/paperinfo/tpci/Objective-C.ht...

I have a feeling it would see a distinct dropoff in usage if Apple were to change their focus to, say, Java or C++.


It's my favorite C variant (including C itself).


I agree. It is exactly what the name implies: a somewhat minimal object orientation layer on top of C.

I wouldn't say the same thing about Cocoa though. Cocoa is good, but not great.


And I'm not without my criticisms of ObjC. I can't stand the lack of namespaces, for instance.


There's GNUstep.


A while back I tried learning Objective-C on Linux. My end goal was to do iOS development, but I wanted to try it out before I spent the money on a Mac. Maybe I'd hate Obj-C and know immediately it wasn't for me...

Using the Objective-C language on Debian was as easy as doing "apt-get install gobjc". But, as you stated, most of the utility comes from Cocoa.

Even though it's technically possible to use Objective-C without Cocoa, in practice it's almost not worth it. It's not like C++ where you can chose between Qt and Gtk+ or some other big library. There's Cocoa/Foundation or there's nothing. It would be hard to find learning material that didn't use Cocoa, even if you wanted to try it.

There are a few alternative Cocoa implementations that run on Linux and even Windows.

Cocotron lets you create Windows apps using Cocoa, but it's a cross-compiler that runs in XCode. Didn't fit my needs, so I didn't try it.

libNuFound was pretty good for the Foundation part of Cocoa, but it took a bit of work to make it work. Objective-C with only Foundation has a lot more functionality than plain Objective-C, but still no where near the usefulness of Cocoa.

The most complete and most popular option is GNUStep. It implements Foundation and a good chunk of Cocoa. They've done good work, but the documentation was lacking, and I never knew whether code I saw on the web and in Cocoa tutorials would work under GNUStep, without trying it. Apple's developer documentation is really good, and I used it as much as possible, but it was pretty common to run into stuff that didn't work under GNUStep. My other big complaint was that it's a really heavy weight "library." I don't know if it's their fault, but I vaguely remember having to install a bunch of seemingly unrelated dependencies just to get their *-dev packages installed on Debian.

Perhaps not the best comparison, but for me, using GNUStep libraries to develop Cocoa always felt like using Wine to run Windows programs.

I had a few other links about setting everything up, but these two were helpful:

http://blog.vucica.net/2010/12/getting-objective-c-2-0-to-wo...

http://orangejuiceliberationfront.com/playing-with-objective...

FWIW, I did eventually buy a Mac, and can say Objective-C and Cocoa on iMac is much easier on OSX than Debian.


For porting Cocoa apps to Windows, there's Cocotron: http://cocotron.org/


You might want to check out Étoilé - http://etoileos.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: