I’ve been listening to Core Intuition with Daniel and Manton for a very long time. Being new to the Apple and iOS ecosystem it’s nice to hear from guys that have been around for a while. They have some pretty unique insights and experience to share with those of us new to community.
I feel like it’s time for me to give back a little. In Core Intuition 209, the talk a bit about Swift. With the advent of Swift, and Apple’s deep commitment to it, it’s tough as an old-time Objective-C developer to see and hear all the attention being given to the new baby. I’ve been in your shoes.
Back in the early 2000’s as Microsoft was making a big push with .Net and C# I was still hacking away on C++ applications written straight against the Windows API. Early on I had my doubts about .Net and C# becoming the development tool of the future on the Windows platform. Fast forward to 2015 and it is the dominant development tool. It just took a bit of time for people to become comfortable with the idea and, more importantly, it took time to people to trust Microsoft was all in with .Net.
I think something Apple has done a really good job of is convincing the development community they’re committed to Swift. It’s the only development tool at Apple that has really reached out to the community. They have a weblog and just this week released Swift to the open source community. Apple is committed.
Does it mean you should run out and rewrite everything in Swift? Probably not, but that is a choice you will have to make on your own. Apple has a huge investment in Objective-C and Cocoa and even if they stopped making huge advances to either it’s going to be years and years before writing code in Objective-C is not a good idea. In fact, Craig Federighi said as much this week in an interview with The Next Web.
“Objective C is forever. I donâ€™t think anyone should fear for the future of Objective C. Weâ€™re going to continue to support Objective C for ourselves and the developer community.”
On Core Intuition the guys each said something that really stuck accord. Manton mentioned Swift’s syntax was a bit too punctuation happy, which I can agree with, and he says it reminds him of C++, which I also agree with. In my case I actually like the C++ language, whereas Manton said he’d rather not go back to it. I would never hold that idea against anyone. It’s an unforgiving language.
Daniel mentions his reluctance to add the Swift runtime to his products just so he can include a new class here or there. I had this same feeling when adding C#/.Net code to an existing C++/Windows API application. It just felt so weighty to get such little support. In those cases I’d say why change? Just keep hammering away in Objective-C if you’re good at it and you can move to release new product quickly. When building a new product give Swift a whirl.
Another great point discussed by Daniel and Manton was how people embrace new languages and find a way to over complicate things. Think about the Architecture Astronaut. Swift brings all kinds of interesting syntax sugar to the table, but it doesn’t mean you have to use it. Start simply, experiment. You’ll find things in the language you love and things you hate. It’s true of every language I’ve ever learned. Keeping your code readable and maintainable is way more important than any syntax sugar offered by the language.
I’ve been working in Swift for the past few months and we’re doing more and more at Agrian with it. All new features are being written in Swift. The language is expressive and once you get going I think you’ll find you can move pretty quickly. We still have large portions of code in Objective-C. We’ve been selective about moving bits of that code to Swift and other parts we leave alone.
If you’re an iOS or Mac developer I recommend you listen to Core Intuition. Daniel and Manton are thoughtful and very experienced developers. Listen and you’ll learn something new.