Ryan Asks, “Should I Learn Swift or Objective-C?”

Today we review a question that is a common concern among beginners thinking about mobile applications. Beginners are now faced with an immediate decision to make before they can even begin worrying about how they can build an application. That decision will have an undeniable impact on the progress they make that will persist for quite some time. Worst, they’re hearing or reading a barrage of opinions on which language they should choose—including opinions that tell them to go away and come back later (learn a different language first), which is a recommendation I can’t get my mind around.

Ultimately, your attitude will dictate everything. Your motivation, focus, desire, and will to succeed. If you want to build an iOS app you’ll build one. The better you are about minimizing the distractions the easier things will be.

Let’s dive into our next reader question:

[alert color=”blue”]Ryan Asks, “I’m completely new to all of this. Should I learn Swift or Objective-C?” [/alert]
Without a doubt, Swift will become the language Apple takes advantage of. Their entire goal is to create a modern, powerful and intuitive programming language for the future of programming on their devices (and probably elsewhere). The problem right now is that it’s going to take time before that fully takes hold. So, do you jump the gun and get out in front of this movement or not?

Finding Your Language

The thing that you’re going to need to remember, especially as a beginner, is that you’re going to have a lot to familiarize yourself with. From the tools and libraries to application architecture and principles. Programming is an endeavor that involves much more than just the code. This will take time and the less distractions you have the better the experience will be.

I began programming in 2005 when I went to Kansas State University. My first taste of code was Java, but I never felt that it was a fun language to deal with. I then started learning C++ out of a desire to become a game programmer, but I felt as if I was chasing my tail just getting basic things to happen. C# eventually showed up, which felt a lot like Java, but I ended up enjoying it much more. Finally, the iPhone was revealed and Objective-C became the language I decided to put 100% focus on. That decision sparked from a simple desire for wanting to build games for a touch device. Since the start of that journey I’ve spent time at a Disney studio coding in Python and a small amount of C++ and over recent years I’ve began learning Ruby.

Oh, and Swift.

That’s a lot of languages. The only thing that I knew, at the time, was that I wanted to build games. The reason I’ve now spent over 6 years with Objective-C is simple—I decided that’s where I really wanted to be. I knew I wanted to build products for mobile so I focused on everything mobile related.

The language you choose today plays a small part in your career. You may discover a new language that really drives you. If, today, mobile apps drive you then you should feel free to just dive right in. The concepts you learn on this path, however, will go far beyond the syntax of a particular language.

Learning Language

Given that programming is much more than syntax, I happen to believe Swift is a perfectly fine learning language. Are there other great starting languages? Sure. Is Swift too young? Maybe. But I fail to see why a person who puts 100% focus on learning Swift will not learn the necessary programming concepts that all programmers should be aware of. One of the biggest bonuses here is that with playgrounds you can quickly experiment on your own thoughts and educators can leverage them in the classroom—reducing the barriers to learning (setting up and/or fixing environment issues, lengthy instructions in order to just get started, and more). Beyond that we’re dealing with a much cleaner language that reduces several headaches.

To continue the first language debate, even institutions have had a hard time feeling like they’ve selected the proper introduction language to their students. I’ve seen Java, Python, and other language exposed to first-year college students. Sure, they may have some corporate pressure mentioning, “This is what we’re all using now! Teach that!”, but the point is that there can be several languages appropriate to learning.

The Support

So what about the support issue? Objective-C and the iOS SDK has been out for quite some time now and the 3rd party support is beyond amazing. You’d be leaving that behind.

For now.

Plenty of 3rd party developers are moving over to Swift. This also gives them a great opportunity to re-evaluate and improve their library. The important libraries are up-and-running, like AFNetworking (an extremely useful library that helps handle communication between your app and the web) now has a Swift version Alamofire.

So, while everything may not be in place right now, it’s not something that should be a complete blow to the beginners. We were there when the iPhone released. While Objective-C had a history, the iPhone SDK and architecture was new. So you’re not going to be the fastest kid in the block–that’s fine.

Example Code

It’s true that a lot of the code out there will be Objective-C, however that’ll slowly change. My recommendation is to be fearless. Ask questions on StackOverflow. Ask your teacher. Ask a friend. Find a mentor. The great thing about the Apple community is that they are an extremely helpful bunch. There are plenty of people out there who love this platform so ping them.

Wrapping up

This blog is 100% behind Swift and will provide examples using Swift. The same goes for guides and books. My goal is to keep each example as isolated as I can make them so you can focus on learning a specific area of interest. In time the examples will grow in scope, but that will likely be reserved for guides.

Feel free to contact me with your questions. Take the example projects from my technical posts and experiment with them.

Takeaway

I sit here, putting myself in your shoes, imagining if I was back in college and just now learning how to build apps for iOS. Objective-C or Swift? I know that I would have picked Swift because it’s where things are moving and that’s where I want to be.

However, if my desire to build games was still as strong I wouldn’t pick either. I would be using Unity3D and would continue to learn C#.

So why pick Swift?

  • Apple isn’t doing this for fun… It’s going to be their future
  • Cleaner language
  • Easier to experiment with
  • You get to build mobile apps
  • A great community will ultimately help where it’s needed

So pick a direction and start running.

Your Turn

Are you a recent newcomer to this iOS development thing? Where did you start? How are things going? Let me know below!


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *