"ObjC is a fine language, but when compared to other more modern tools in the same space (C++, Java, C#, D, Go, maybe Haskell, etc...) it really doesn't have much to recommend it."
Much simpler than C++. Much more dynamic than any of the languages you mention. Can use straight C anyplace you need performance, with no FFI. Finally has some decent syntax for JSON types (NSDictionary/Array/Number), which some of those languages have and some don't. Performant collection classes.
Block syntax (Java famously lacks, those other languages have some equivalent).
An outstanding UI library, unfortunately tied to Apple devices.
I think Objective-C has stood up brilliantly to the test of time. The potential for Ruby-like flexibility with C-like performance, it's not an accident the software behind Apple's rise to the most valuable company in the world (for a time), was written in Objective-C.
IMO the ability to transparently call into C is ObjC's only redeeming feature and pretty much the only reason I use it. You can get the performance and dynamism elsewhere (at the least, you can go for a different language built on the same runtime, like Nu), but you can't get the C elsewhere. The fact that ObjC is built on C is simultaneously the best and worst thing about it, as nearly all of the language's problems stem from that as well.
I disagree about it being there when Apple rose to power, though. I think it was an accident, like so many other accidents of history. NeXT provided Apple with a solid base for the future, but IMO they could have done it decently well with Be instead. The most important thing they got from Next was Steve Jobs. ObjC just happened to be in the right place at the right time to be chosen as the GUI programming language by NeXT, and NeXT just happened to be in the right place at the right time to leverage their technology into a takeover of Apple under the leadership of a guy who was ready to change the world.
In the alternate universe where Apple bought Be, Apple is dead because most programmers aren't smart enough to write GUI apps for Be's asynchronous model. They find it bad enough in Javascript's callback hell world- But doing that asynchronous Node.JS style stuff in C is a non-starter.
In the alternate universe where Apple bought Be, nobody can take advantage of most of the existing C libraries, because they were written expecting to be used in a synchronous programming model.
I don't think this would have worked. As cool as Be is, and as much as, fundamentally, it is a better operating system in most ways than NeXT. Be does things 'The Right Way'. But sadly, Worse is Better. You have to optimise for the programmers you have. not the ones you wish you had. Be was ahead of its time, and it's still ahead of its time.
Obj-C has the significant advantage of being a fairly thin layer over plain C so it's lightweight and easy to port. This means you can bootstrap it on a new platform pretty easily, write in a fairly high level language for most of your application code, and transparently drop down into C for performance.
Had it not been for mobile I think Obj-C would have quietly died out but it happens to embody a pretty good set of compromises for small, resource constrained devices. Recent developments like ARC and blocks make it a lot more pleasant to use now than it was even a few years ago.
Well, I think you know a lot more about this topic than me, but I would like to ask a follow up question.
Do you think Apple could have iterated as rapidly on iOS GUI applications, while keeping performance fast and resource usage low, if everything was written in C++? Java? C#? Objective C seems to hit a sweet spot for experimenting with innovative new UI concepts in a constrained hardware environment.
I think C++ would have done fine with a suitable toolkit, which presumably they would have built based on the stuff from Be, in my alternate history where Apple bought Be instead of NeXT but somehow still got Steve Jobs. Given the choice, I'd rather do a GUI framework in C++ than Objective-C, but I don't think it's that big of an advantage, at least if you can restrict yourself to a sane subset of C++.
Java... harder to say. I would say that no, Apple could not have done as good a job using Java as the basis of iOS, because Apple doesn't seem to be very good at the things needed to make a language like Java run fast. Perhaps if they had contracted out the right bits to Sun rather than pulling a Google and building their own VM, it could have worked OK.
I think that Objective-C is a pretty good language when you take into account the context of running on a UNIX system with lots of pre-built C libraries around, because of the ease of talking to C. Perhaps even the best choice, in that limited context. But I don't think much of Apple's rise can be attributed to that choice of language, even if it did end up being a decent one.
> I think C++ would have done fine with a suitable toolkit, which presumably they would have built based on the stuff from Be
BeOS, while a nice operating system, was notoriously difficult to program for, largely due to the use of an asynchronous API.
> because Apple doesn't seem to be very good at the things needed to make a language like Java run fast. Perhaps if they had contracted out the right bits to Sun rather than pulling a Google and building their own VM, it could have worked OK.
The "Apple" JVM pretty much is a licensed Sun JVM with extra bits. It's also of comparable speed to the Sun JVM; the performance gap between Apple Java 1.6 and Sun/Oracle Java 1.7 on a mac is comparable to that between Sun/Oracle 1.6 and 1.7 on Linux.
> But I don't think much of Apple's rise can be attributed to that choice of language, even if it did end up being a decent one.
Certainly not entirely. However, one advantage that iOS did have early on was that it wasn't totally horrible to write for, which had been a traditional affliction of smartphone OSes. Possibly they'd have come up with a decent C++ API, of course, but then again possibly they'd have come up with something like the Symbian API.
The apple software is not written in obj-c 'cause it gained traction by developers preference, it is written in obj-c 'cause Steve Jobs, after returning to apple post NeXT experience and buyback, imposed that as the only apple officially supported language.
C++ and Java were first-class languages in MacOS until quite recently; while the intent was always there to deprecate the C++ API (Carbon), the Java Cocoa bridge was dropped more due to lack of interest a couple of versions ago.
Much simpler than C++. Much more dynamic than any of the languages you mention. Can use straight C anyplace you need performance, with no FFI. Finally has some decent syntax for JSON types (NSDictionary/Array/Number), which some of those languages have and some don't. Performant collection classes.
http://ridiculousfish.com/blog/posts/array.html
Block syntax (Java famously lacks, those other languages have some equivalent).
An outstanding UI library, unfortunately tied to Apple devices.
I think Objective-C has stood up brilliantly to the test of time. The potential for Ruby-like flexibility with C-like performance, it's not an accident the software behind Apple's rise to the most valuable company in the world (for a time), was written in Objective-C.