views:

294

answers:

5

I know that the Apple community – including Mac and iPhone developers – mainly use Objective-C for their development language. But it seems that not many people use Objective-C outside of the Apple community, such as in the Windows or Linux worlds.

What are the possible reasons that Objective-C is not particularly popular outside of the Apple community?

A: 

Off the top of my head, I believe C++ is older than Objective-C, and not only for this reason has a much bigger user base. Everywhere that OC may have come, C++ was already there :)

Also, C++ has more features. Many people are impressed by lots of features. And it's had more research and development poured into it... and so forth. Essentially, momentum.

Carl Smotricz
C++ isn't really older than Objective-C--they both date from the early 1980s.
eman
For anyone interested in those dates on a finer scale, I looked this up: Development of C++ started in 1979 and it appeared in 1983; work on Objective C started in 1982 and it was published in 1986.
Carl Smotricz
+8  A: 

This is a complicated question; but in short; I think the answer most likely lies in the age of the operating systems, and their roots.

  • UNIX is C, so that's that.
  • Linux is envisioned as a straight-up clone of Unix, (Fine, this is slightly inaccurate, but close enough for this discussion) and as such, it is more or less written in C.
  • Windows is an old operating system; and one that is built by stacking hack upon hack going back all the way to Windows 3.1. C++ is heavily favored, and in .NET, C#.

    This new influx is of course based on whatever agenda Microsoft has with that platform.

  • Mac OS X; on the other hand, is a (comparatively) young operating system, and it's new parts (while still quite old, being inherited from the NeXT and whatnot) are all based on Objective-C because, "Hey! Why not?".

    As backwards compatibility was not among the list of priorities with Mac OS X 10.0; the C/C++-based Toolbox and Carbon got the short end of the stick, and the entire operating system was more or less made as a reskinned version of NeXTStep.

The issue with Obj-C is that the power of the language comes mostly from the sizable frameworks, the generally high level of integration into the system, and so on. It's almost impossible to get a good jive like that going without a clean break from backwards compatibility and, as such, it would never really stand a chance on any platform that didn't dare to do this. Apple, with a small (at the time) and devoted user base, dared do this, and struck gold.

Microsoft is now trying, but are, in my humble opinion, failing. ("Failing?! .NET!? HOW DARE YOU!?": With 4 major revisions in about 8 years, they are doing more growing than maturation; which may be a good thing, if they can turn it around.)

Edit: There are some projects attempting to port OpenStep to Linux, but they are a bit clunky and hard to use; there are also smaller projects on NS/OS-likes with smaller problem domains, but it's uphill work.

Williham Totland
+1 for "sizable frameworks". I think that's probably one of the key factors.
Perspx
I'm sorry, are you suggesting that Microsoft should let .NET develop incredibly slowly like Java has done? The major revisions have added a lot of functionality to both the languages and the platform. I don't see why that should be regarded as a failure.
Jon Skeet
.NET 1 came in 2002, so 4 revisions in 8 years - not so bad.
Al Bundy
@Jon;@Al: Changes need to be slow and deliberate. Just "adding stuff" doesn't make for a good framework. **Edit:** This isn't a discussion about .NET, and I didn't intend to turn it into one. I will edit the post accordingly.
Williham Totland
@Williham: I agree that "adding stuff" doesn't make for a good framework - but it doesn't make for a *bad* one either, as you're implying. This isn't being done in a giant ad hoc manner (although there are plenty of projects *not* in the core framework if you want to look for experimental stuff).
Jon Skeet
@Jon Skeet: Adding stuff is fine. "Merely adding stuff", on the other hand, is not. I freely admit that I do not do a lot of work using .NET, and when I do, I loathe it. ;I But from what I've seen, and correct me if I'm wrong, it seems that .NET revisions have a propensity for adding complete replacements for things where simply adjusting the existing behavior should suffice. I guess it all comes down to perceptions, or, if indeed I am correct; a crippling fear of breaking backwards compatibility.
Williham Totland
@Williham: Well, I think you're wrong. Where there have been "replacements" (e.g. WPF for WinForms, WCF for web services / remoting, Parallel Extensions for manual threading, ASP.NET MVC for web forms) they're pretty widescale changes with a grander vision rather than "adjusting the existing behavior". .NET has certainly been evolving at a very rapid pace, but I'd be hard-pressed to point to many areas of that evolution which are unwelcome.
Jon Skeet
+2  A: 

Objective-C is nothing but a thin layer(a bit thicker with 2.0) of syntactic sugar for message passing on top of standard C. Even the most basic object orientation is provided by the runtime library, which was proprietary for a long time. Inertia is an important factor in language use.

It shines especially on GUIs, but the only toolkits that support it are Apple's and the mostly unknown and catchup-playing GNUStep.

While there is some value for Objective-C outside of GUIs, and I think people would use the extensions were they imported to C, even in system code, there is little reason to choose it over alternatives, when little of your system is meant to work with it.

jbcreix
+3  A: 

@William Totland

Sorry, but your post has many problems.

Firstly, you confuse the language of choice in which the operating system with the language of choice for developers of applications for the operating system. Sure Unix is written in C (that includes Mac OS X by the way), but a lot of other languages are well supported on it. Same applies to Linux, of course.

Windows is not an old operating system. The Windows in a modern desktop computer is not related to Windows 3.1. Windows 3.1 (and 95) were written in assembler. The Windows you have today descends from NT and was written in C (same as Unix).

Objective-C is a superset of C (much more strictly than C++, in fact) so the issue of backward compatibility does not arise. Anything you can do in C you can do in Objective-C.

The framework issue is real, however. Java, Perl and .Net also have large frameworks but those of Java and Perl have been ported to all popular platforms whereas .Net runs on the platform with more than 90% of the desktop market. The Cocoa framework used by Objective-C GUI applications is only available on Mac OS X with only a less fully featured "clone" available for other platforms. C#/.Net and Objective-C/Cocoa are both in similar positions, one being more or less Microsoft only and the other being more or less Apple only.

JeremyP
While it is true that "Anything you can do in C you can do in Objective-C."; this has no bearing on the point I was making: The Toolbox and Cocoa do not only use (marginally) different development languages; they use entirely different and often incompatible approaches to the structure of the code, and often times the functionality present. Carbon got the shaft, not in the sense that the language is particularly alien, but in the sense that the approaches and models were radically altered; as well as the underlying system APIs.
Williham Totland
+4  A: 

I was recently standing in a bookshop reading Masterminds of Programming where the creators of programming languages talk about their creations. There was one chapter about Objective-C where Tom Love (one of the creator of Objective-C, along with Brad Cox) was asked why C++ had gone so far, while Objective-C hadn't:

Why do you think that C++ was used more frequently than Objective-C?

Tom: It had the AT&T moniker behind it.

Just that?

Tom: I think so.

What do you think about Objective-C today?

Tom: It still exists. How about that?

nevan