Objective-C Is Our Generation’s COBOL
Sometime this year, probably right around now, Swift will surpass ObjC in search traffic. The number of people trying to google some Swift question will be greater than the number of people googling some ObjC question. Around now. Not next year, not when you’re planning your next major version and might have more time to think about porting a few classes. Right now.
[…]
Pretty much every new iOS developer I talk to is learning Swift. Not ObjC. Not Swift and ObjC. Just the Swift.
[…]
Your ObjC codebase isn’t going to go away. Just the people willing to work on it. Sorry.
My first reaction is to point out that of course there’s more search traffic for a language that’s new, in flux, and much more complex than its predecessor. That said, it’s quite possible that we have reached Peak Objective-C.
I’m having a good experience with Swift so far. It fixes so many things that have long annoyed me. There are certainly problems with Swift, but Apple is working at an impressive pace to address them. I do worry a bit that using Swift is going to paint me into a corner. Crawford writes:
Swift is essentially a superset of ObjC. Other than a few weird trivia questions (
#pragma pack
anyone?) you can do everything in Swift that you can in ObjC, and much, much, more.
This is mostly true, and you can migrate code piecemeal, but it does seem like there’s a point of no return. First, you cannot subclass a Swift class in Objective-C. Second, it doesn’t interoperate with C++. Third, Apple doesn’t really talk about it, but the bridge for Objective-C and Swift strings and collections is not toll-free. There seems to be overhead in just passing bridged objects back and forth between the two languages. This is probably not a problem in most cases, but it’s not clear to me what you can do if this bites you.
This is more a problem with Swift interoperating with Cocoa than with Swift the language. But if you’re writing an app, working well with Cocoa is what matters.
I’m bullish about Swift, but it’s nuts to port a large, mission critical app to it, today.
This is a pretty accurate analysis. Having been an early patient, I can report mixed outcomes and excitement about the future.
I’m aware of two projects, one at a startup and one at a big big company, that were rewritten in ObjC after starting in Swift.
Every new line of Objective-C you write today is technical debt in a Swift world.
Update (2016-03-22): Joris Kluivers:
Had to revert back to Objective-C for a delegate implementation. NSDictionary -> Swift Dictionary conversion for a param didn’t perform well