Is Objective-C only used for development on Mac OS/iPhone? [closed]
Asked Answered
F

7

26

I don't know Objective-C but to me it appears a nice language. But the only context I know it from is everything Apple. But Objective-C is even in the GNU Compiler Collection.

Is there something missing in the open ones? Or is there already a broader base for Objective-C? I'm interested if there are companies that chose Objective-C to develop their products.

Ferret answered 17/5, 2009 at 14:14 Comment(0)
J
41

I think ObjC has been isolated to the Apple world through a quirk of history and the nature of proprietary systems.

First, you need to separate ObjC from Cocoa. ObjC is a very primitive language. I think it is a very elegant language, but it is extremely basic. You can implement ObjCv1 in a C pre-processor. C++ and ObjC were developed about the same time. C++ put a huge amount of infrastructure in place to bring a C-like syntax to what is basically a completely different language. ObjC brought a Smalltalk-like syntax to C, with almost nothing else. Even things like +alloc and -release aren't language elements of ObjC. They're fairly simple wrappers around malloc() and free().* Standing on its own, ObjC isn't really that interesting (elegant as I think it is). This is very similar to the nature of Smalltalk. Without its object libraries, there isn't much you can do with it. With its object libraries, it's incredibly powerful.

NeXT provided this entire framework on top of ObjC called NeXTSTEP. Since the NeXT computer was not a widespread commercial success, and NeXTSTEP was proprietary, not many people learned the framework or the underlying language. When Apple bought it, and morphed it into Cocoa, it continued to be a proprietary system.

GNUStep is out there, but they never developed anything interesting enough to bring in a lot of developers (a major web browser or word processor or the like). And Cocoa has gotten well ahead of GNUStep over the last few years. It's possible that with the rise of interest in Cocoa due to iPhone, that GNUStep may revitalize and bring a nice cross-platform development framework, but I kind of doubt it. Folks who have a background in C++ look at C# and see a clear improvement. When they look at ObjC, they see a lot of square brackets where they don't expect them. For people raised on the "calling methods" paradigm, the Smalltalk paradigm of "passing messages" is alien and even a bit scary. Many developers assume they need a strongly typed language to avoid bugs and are uncomfortable with a system that relies primarily on programmer discipline and careful consistency. It is much easier to hack something that "just works" in C# than in ObjC. ObjC really expects a lot more of the developer in understanding what's going on and not relying on the compiler to protect you from your hacks.

Basically, folks knew C from Unix, and C++ makes sense in terms of C, and Java makes sense in terms of C++, and C# is just cleaned up Java. ObjC isn't any of these. It's Smalltalk, and no one learns Smalltalk anymore.

* I recently chatted with the guy who wrote +alloc about its history, and he might object to my calling it a simple wrapper given the inclusion of zones. So for you who know the difference, replace +alloc here with +new.

Juliajulian answered 17/5, 2009 at 15:31 Comment(2)
Thanks for the insight. I want to learn it because it is smalltalk which I loveFerret
Ah, then you are half-way to the Cocoa Nature already. If our industry remembered half the lessons we learned in Smalltalk, we'd be twice as far ahead today. I have a team full of newly minted Computer Science graduates from excellent schools, and I still have to teach and re-teach the basics of Model-View-Controller.Juliajulian
P
15

Well, there is also the GNUStep framework that some people still develop for. I don't know how active that community is, however.

But for the most part Objective-C is now an Apple language, as illustrated by the fact that the "2.0" version of the language was launched as part of OSX 10.5 and seems to have been a purely in-house development effort at Apple.

Edit: Apple, as you probably know, has something called the Cocoa framework, which basically refers to the entire stack of libraries for Objective-C, including the NSObject common baseclass. Cocoa is a continuation of the NextStep library, which GNUStep is the open-source version of. So you'll find many of the NS-prefixed classes both places, but Apple has not held back in adding new classes or changing them in Cocoa, so interoperability at the GUI level is really only a theoretical possibility.

Prophase answered 17/5, 2009 at 14:18 Comment(6)
Beat me with GNUstep by 6 seconds!Zerelda
I don't know if there is still GNUStep development but a while ago I found etoile OS on the web which is active. My question was just meant differently. I'll adjust the questionFerret
Originally it was developed by Brad Cox and Tom Love, although Wikipedia cite it as Apple being the developer (en.wikipedia.org/wiki/Objective-C), since it was licensed from them originally by NeXT and then acquired by AppleDunton
Not to nitpick, but it's GNUstep, not GNUStep.Zerelda
Wasn't WindowMaker GNUstep based? Still my favourite "low spec" window manager.Prussianism
This is a common misconception but WindowMaker was never based on GNUstep. The only thing in common is that it shared the NeXT look and feel. And by now GNUstep is gaining great theming capabilities.Argeliaargent
T
11

@Stephen: I'm constantly surprised at how people never read our website or even check on the progress of the project before saying things like this. :) GNUstep follows Cocoa closely now and we're so much more than OpenStep at this point. If you, or others, want to have a real opinion on the subject get GNUstep from SVN, install it and try it out. Pontification about something you know nothing about (as demonstrated by your response here) is pointless.

Greg C. GNUstep Lead Developer

Traceetracer answered 7/3, 2010 at 5:38 Comment(0)
K
6

GNUstep is actually much more active than most people think it is, and very worth keeping an eye on. It's not hard to create apps that work across GNUstep and Cocoa (meaning potentially on OSX, Win, Linux, BSD...)

These links are definitely worth checking out for anyone interested in the topic:

http://www.gnu.org/software/gnustep/information/aboutGNUstep.html

http://etoileos.com/news/

http://www.nongnu.org/gap/

Then there is Cocotron, an "open source project which aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.'s Cocoa documentation":

http://www.cocotron.org/

EDIT: For an example of a commercial cross-platform product built with GNUstep, check out Eggplant.

Kinsman answered 15/6, 2009 at 15:28 Comment(0)
Z
4

GNUstep. There is also Étoilé which is an OS built with GNUstep.

I think many people just like C or C++ better, and if they wanted a more modern language, they would use C# or Java.

Zerelda answered 17/5, 2009 at 14:18 Comment(3)
I think quote the opposite. You can do system level development with objective-c and can integrate a modern part into it. To me it appears really powerfulFerret
Why do you think Etoile is an OS. I only know it as desktop environmentFerret
@Norbert Hartl: it is more of a desktop environment (like GNOME or KDE), but the web address itself even says it is an OS.Zerelda
P
1

I think the Apple implementation is just better supported and still in active development. There are some other places, such as GNUStep, but they still look to be very much at the NextStep/OpenStep level. Unfortunately a lot has happened since then!

Patnode answered 17/5, 2009 at 14:20 Comment(0)
I
1

The Mono team are doing something with iPhone development which allows iPhone apps to be written in .NET and cross-compiled with the Mono .NET compiler(s). Check it out at http://www.mono-project.com/Mono:Iphone

The latest .NET Rocks podcast has Rory Blythe talking about stuff he's been doing in objective C and iPhone development.

Inboard answered 15/6, 2009 at 15:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.