Replacing Objective-C

Ash Furrow, one of the developers at design powerhouse Teehan+Lax, has a very relevant (to me) post titled We need to replace Objective-C. In it, he points out a number of things that bugged me - and still bug me - about Objective-C:

If you accept the premise that programming language abstraction increases over time, then consider where Objective-C is on our progression. Pointers. C-based APIs. No virtual machine. Ugh.

I've used managed languages since 2000 - first Java, then C# from 2002. I've dabbled in Ruby, Python and other languages, but going to Objective-C was like stepping back to 1997.

Apple has done some good things with it - ARC, for me, solves about 80% of my problems with it, and at my current job, I'm enjoying writing Objective-C code. As Rowan has pointed out before:

An argument between two developers about which language is “best” is like a debate between an Englishman and a Frenchman. Each will prefer their own language. And each will be right because they will both be able to express themselves best in their own native language.

And again, while the debate continues, important problems remain unsolved.

But back to Objective-C. The language, by comparison to others, is stagnant. They have added a little syntactic sugar, but thats about it.

Now, the counter-argument is that Apple has been making strides in Objective-C development. They deprecated GCC in favour of LLVM. They added blocks. They added collections literals. Yeah, and that's all great, but those are all incremental improvements.

Those are all good things (especially blocks - Java/Android can't get Lambdas soon enough for me), but compared to other languages, it's not enough. The world has moved a lot since the turn of the centuary. In a similar timeframe, Microsoft (and Xamarin) have added generics, object querying (LINQ), concurrency (async/await), nullable types, implicit typing and host of other stuff.

Steve Streza has a great follow up post, where he lists a number of things. He's right on all counts, but there are a number of elephants in the room - and thats some of the "alternative" languages which exist right now for iOS and Mac development.

Both of these fit the bill on most, if not all, of Steve's points. The Xamarin tools even roll in a strong functional language in the form of F#, as well as Android, Mac, Windows, and Windows Phone support.

The one thing I really don't want to see replaced - which both articles imply needs to be, at least in the title - is Cocoa and CocoaTouch. It's not perfect, but it is a fantastic toolset for creating rich, detailed, polished applications. Don't throw that baby out with the Objective-C bath water.

I don't see Apple doing anything with this in the near term. But as Ash points out:

The point isn't that Objective-C needs to be replaced today, but rather that eventually, progress in programming languages is going to leave it behind. Someday, someday soon, writing Objective-C as we know it today will seem as antiquated as writing assembly. That's going to hurt Apple.

If writing iOS and OS X apps is as cumbersome as writing assembly, by comparison to modern programming languages, then what will Apple do?

A little background/disclaimer on me: I'm a native C# speaker, but I can read (and write, to varying degrees) Java, Objective-C, Ruby, Python and Javascript and possibly a few others. My day job is Objective-C and Java, which I'm mostly enjoying. My "other day job" is all C# using the Xamarin tools, with a bit of node.js thrown in for good measure.

Nic Wise

Nic Wise

Auckland, NZ