5 Reasons to Learn to Code in Swift

June 17, 2015
 
Ashley Rondeau

Earlier this month, Apple announced Swift 2, an updated version of the app programming language that Cupertino has been pushing for over a year now (to give a sense of how hard Apple is pushing it, at WWDC all the sessions were done in Swift). The new update comes with a slew of new features, and it prompted us to explore the many reasons more and more app developers need to learn how to code in Swift if they want to continue to be relevant in iOS. Here are the top 5 reasons to learn to code in Swift.

1. It’s going open source. And everywhere.

The biggest announcement on Swift, that literally drew cheers from the crowd, is that it would be available under an open source license. Why was this such a revelation? First off, this is a fairly uncharacteristic move from Apple; how often do they go open source with anything? Sure, Google’s Android has always been open, but Apple has traditionally kept everything very proprietary. Perhaps they are testing the waters of open source since they’ve witnessed Android’s successful proliferation using this strategy.

Second, app developers love this move because they’ll be able to really dig into the Swift language and play around with it. The real power of Android was unleashed when talented programmers molded it to fit their own needs, and that’s what will happen with Swift as well. Of course, being open source, it allows developers to port the language to other platforms; even Windows and Android. We’re going to be seeing Swift everywhere soon, so now is a great time to learn the language.

2. It’s easy to learn, especially for beginners.

Compared to Objective-C, many programmers feel Swift is more accessible and less intimidating. For example, App Camp for Girls, a great organization empowering young women to take up coding, is rewriting their camp apps using Swift. Volunteers at the camp believe Swift is “easier to understand and thus easier to teach and learn.”

Raphael Miller, mobile app developers for Getty Images, said “we’ve noticed that with Swift you can bring in junior people quicker…. The learning curve is still there, but it seems like people pick it up faster, and they’re less worried about syntax and more about just writing code.” Because of this lower barrier to entry, we’ll be seeing more young programmers cut their teeth on Swift in the future.

3. It’s less prone to bugs and breaking.

 One of the reasons Swift is great for beginners is that it tends to be much more forgiving than Objective-C. It handles information more intelligently, it manages memory better, it’s more efficient. So programmers usually see less crashes while performance is at least on par, if not better. “Swift seems like it finally gives the developers in the iOS world the ability to do the things you have been able to do in the scripting world but without the penalties,” said Daniel Doubrovkine, head of engineering at Artsy.

One example of Swift’s advantage over Objective-C: coders don’t have to declare the type of variable if they are assigning values to it. Swift will “infer” the type, which is something ObjC doesn’t do. Thus, there are less places for mistyped code. Smart features like this, along with the huge benefit of seeing real-time changes in this “live coding” language, and it’s easy to see why Swift is such a hit.

4. It’s faster than Objective-C.

 When Swift premiered, benchmarks put Swift performance markedly slower than ObjC. But in about a year, that all changed and now is much faster. There are many technical reasons why Swift sees faster performance (feel free to read about them here and here), but it’s been winning over converts. Couple this with Swift just being faster to code in, and you’ve got a winner. Here’s a great example of how Swift allows for shorter, more elegant code. Here’s how to create a record of favorite numbers in Objective-C:NSDictionary *favoriteNumbers = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:7], @”Jane”, [NSNumber numberWithInteger:21], @”Bob”, [NSNumber numberWithInteger:99], @”Sarah”, nil]];
and here it is, much more succinctly, in Swift:
var favoriteNumbers = [“Jane”: 7, “Bob”: 21, “Sarah”: 99]

5. It’s already growing like crazy.

Here’s a fun little chart from Stack Overflow via Slashgear surveying over 26,000 developers:
Screen-Shot-2015-04-10-at-2.12.42-PM-600x406Developers love Swift. Remember, it was only introduced last summer and it is already ranked #22 in language popularity in a study by RedMonk, which is “unprecedented” growth. Big company names like Lyft and SlideShare are already making the switch.
Still, less than 8% of developers currently use Swift. If anything, this tells us that now is the time for app developers to add this language to your repertoire. It’s on fire, but it’s still the wild west. We think first-movers in this field who can establish themselves as Swift developers will have a leg-up as the language matures and more and more people look to develop apps using it. We’re certainly gung-ho about Swift at Rocket Farm Studios, and can’t wait to see how it matures now that it’s open source.RFS-Banner-LinkedIn

So, if you don’t know where to get started with a blueprint for your app, Rocket Farm Studios can take the pressure off.

rocket logo

I hope you enjoy reading this blog post.

If you want our team at Rocket Farm Studios to help you with your app, just book a call.