When I got into iOS development a few years ago, Objective-C was the way to go for native app development. I had studied the language in the mid to late eighties, and was surprised at the differences between it and C++.
Admittedly I didn’t take it that seriously. There were precious few resources out there from which to learn.
When I got back into it, I was surprised at how much it (and XCode/LLVM) had evolved, and continued to evolve. This was both nice and a pain.
Code on the web still contained old samples which were confusing. Thankfully a few Lynda.com videos by Simon Allardice helped explain the convenience features which each new version of XCode introduced.
I must say Automatic Reference Counting (ARC) was a god send. It has helped immeasurably.
A lot of people who begin coding with Cocoa or Cocoa Touch experience a little bit of culture shock. It’s not often that a platform pushes design patterns such as delegation on you, but such is the case with Apple. This isn’t a bad thing, mind you.
To me this is a good thing. It was like someone pushing my program in a good direction.
Still, it was an adjustment.
I loved learning Apple culture as I began to learn the frame works. In fact I fell in love with it (thus the name NSBliss).
Trouble in Paradise
Alas, however, all is not perfect in Objective-C land. Objective-C still lets me write perfectly legitimate C code, and that’s a bad thing.
I admit I have, on occasion, succumbed to temptation and used a few C structures, most notably arrays, and yes, I have been burned by referencing values outside of their bounds.
And yes this was perplexing to debug.
You’d think I’d have known better, right?
But what better way to learn the lessons of Swift. Swift’s modern features would have made my sloppy practices impossible.
The shortfalls of C are not only inconvenient, they are security risks.
So, in my mind, the time has arrived to ditch Objective-C.
Why I haven’t Adopted Swift
I’m going to be absolutely honest. There is really only one reason why I’m still using Objective-C. Objective-C has more code examples on the net.
Like it or not Stack Overflow is the killer app for developers these days. If you’ve experienced an issue, chances it’s appeared somewhere on Stack Overflow, if you know what to look for.
Right now, Swift is a year old. There is a lot on Stack Overflow, but still Objective-C rules that roost for iOS/OS X developers.
This is changing quickly, however. The Swift adoption rate is astounding. By some accounts, 20% of all mobile development is being done in Swift.
I suspect I will switch to Swift soon. Perhaps on the plane out to WWDC 2015 I’ll finally start down that path. It will be interesting to see how much emphasis is on Swift this year and if Objective-C is still evolving.
I’m reminded of the days when I saw CD’s replace vinyl in record stores. (Of course vinyl is now making a resurgence, but we won’t go there.)
In short, the writing seems to be on the wall.