We feel, like many do, that Swift – Apple’s new programming language – isn’t quite ready for production. We aren’t currently using it for any projects beyond small internal experiments. Swift is still undergoing heavy revision by Apple and the tools provided for Swift development are in need of refinement. But make no mistake Swift is coming.
For now, one major concern is that if you wrote code with previous versions of Swift, that code may not work on new versions of Swift. This doesn’t bode well for any programming language. Imagine if the program you wrote a month ago didn’t work anymore and the only way of getting it to work was updating your code or finding the particular compiler version you used then.
Due to the problems with Swift, some developers have stated they will never adopt Swift. An example quote is “Apple can no more scrap Obj-C any more than they could scrap C or C++”. This simply isn’t true and Objective-C will be scrapped at some point. In the minds of Apple Engineers, it may as well already be dead.
Having worked at Apple, I know that they work very hard to make sure that things do not break over time for developers. This unstable state for Swift isn’t a normal state by a development environment offered by Apple. They have people working there who truly care about not breaking your programs and are thinking about that every day. Having said that, I also have seen times where Apple draws a line in the sand and says “we are advancing now, whether you want to or not.” Like the iMac shipping without a Floppy Disk or the iPhone shipping without a physical keyboard, Swift is one of these transition points.
Transition from Carbon to Cocoa
I saw the tail end of one of these transitions, in all its gore and glory, while I was at Apple. And gory is exactly what it was for the people who waited too long and didn’t transition. It was the Carbon to Cocoa transition at Apple.
During the early phase of the transition, development continued on both programming environments and both parties benefited because features were ported from one language to another. Cocoa and Carbon programs were treated as near equals. But over time, Carbon started to suffer and so did the Carbon developers.
To make your Carbon application, you had to take extra steps that a Cocoa programmer didn’t, but you didn’t mind it. It was just how things were – kind of annoying, but not a big deal. Then a tipping point was reached and this barrier continued to grow with no end in sight, and life became miserable for Carbon developers.
Cocoa is now commonly referred to as Objective-C.
Your future if you don’t switch to Swift
For the Carbon programmer who held on longer then they should have, they had to deal with Apple development tools that were not fully tested. Critical bugs that hindered your development were marked as low priority by Apple. If the same bug showed up on both platforms, it would be quickly fixed for Cocoa, but it took months to be fixed in Carbon. Or maybe it was never fixed at all. The Carbon documentation wasn’t as fresh either, leading to even more frustration for developers. Not only that, but some cool new APIs were not available to Carbon programmers, because it would be too much work to port it over.
This meant that all new development was being done for Cocoa and none was being done for Carbon. If Carbon worked or not wasn’t important to Apple. You can imagine how that would feel as a Carbon developer and for the poor programs you wrote and your poor users relying on programs written in a now outdated technology.
Now re-read those last two paragraphs and substitute Objective-C for Carbon and Swift for Cocoa, and you are reading a future that will come to pass. Apple isn’t going to hold back on Swift. Yes Objective-C will still be around, but it will come to be an unstable mess that won’t be maintained, and you as a programmer will have no choice but to adopt Swift.
Objective-C, today a flourishing language, will one day be a dead language. No, not today. Maybe not even soon. But it will come to pass.
Do I recommend adopting Swift today? No. It isn’t ready. But one day it will be it will reign supreme on both the iOS and OS X platforms. Bitter regret will be found to all who don’t adopt Swift by then. Get ready now. Swift is the coming and it will be the death of Objective-C. You have been warned.