Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Hi, I want to start with ios courses but I see there is swift 2.0, development C and Development with swift.

Hi,

I want to start with ios courses but I see there is swift 2.0, development C and Development with swift. Not sure where should I start and wondering if there is to much difference between swift 2.0 and development with swift ?

I appreciate your comments

Martin

2 Answers

I'm not sure how many of my peers will agree with me, but I would personally start with Objective-C, because it's a much older and more stable language with way more support on the internet. It'll also give you a better grasp of many of the core concepts of iOS and why things work the way they do. If you decide you like iOS after that (or if you decide you don't like Objective-C), you can try the Swift 2 track. The regular Swift track is obsolete and should never be taken

Personally, I'd recommend you to start with Swift 2.0 and THEN try Objective-C. Swift 2.0 is the most recent way of making iOS apps. It's up to date. And moreover: Swift is easier to understand than Objective-C, I would argue. Regardless of where you start though, you'll want to learn both Swift 2.0 and Objective-C. You could try them both side by side, if you prefer. Swift (1.0) is obsolete though, like Michael said. It'll probably be removed once all courses are available in Swift 2.0.

I was hoping someone would recommend that, so we could have a productive discussion as to which way is better that I could potentially link to in the future, as I'm designing my own curriculum right now, and I still haven't definitively chosen the language.

I say Objective-C should be the first language of an iOS developer.

As a language, Objective-C can do less than Swift, so there's less to learn. Because of that, it's easier to pick up than Swift, in my opinion. Also, if you go Objective-C to Swift, the reaction will be greatly positive ("I can use an initializer for an enum!?"), but if you go the other way, you'll feel constrained ("Ugh why can't I write a member function on this struct").

Objective-C is also used way more often than Swift, at least in the corporate world. If your goal is to get a job in iOS, you should go with Objective-C hands-down, because you'll have way more opportunity. If you also want to get into jailbroken development, you'll have to use Objective-C, because Swift functions can't be hooked, and Cydia Substrate only supports Objective-C. Being that it's an older language, the most common answers to iOS problems, especially the more advanced ones, are in Objective-C, and not Swift, and the burden is on the programmer (who might not know Objective-C) to convert it.

Swift is also still a rapidly evolving language. They're still making decisions as to what operators should be included in the next version, which isn't a problem that Objective-C has had since the 1970s. What you learn in Swift now might not be valid code in a matter of months, which can be jarring and discouraging to new programmers.

Learning Objective-C will also give you a better understanding of why things work in UIKit/Foundation/all of Apple's other libraries. Working with them in Swift feels weird (even though it's necessary), because they don't utilize a very large portion of Swift's awesome features, like tuples or default parameter values. Why are a lot of Cocoa Touch APIs imported to Swift as implicitly unwrapped optionals? If you don't know Objective-C, you might not know the answer to this question, but if you do, you'll know that it's because Objective-C doesn't have the concept of optionals and anything can be nil, so Swift has no way to know what's going on.

Swift doesn't even run natively on iOS yet. It's still compiled down into a Swift object file, and an Objective-C library is silently included to tell the Objective-C runtime how to use it. This won't change at least until the Swift ABI is stabilized with Swift 3 this fall.

I personally learned Objective-C first, and I feel like I have a far deeper understanding of iOS than if I had started with Swift. I think Swift is the future, but the future isn't here yet. Thoughts?

You've got some great arguments, Michael! However, I'd say some points are debatable. You mention how Objective-C can do less, and therefore there's less to learn. I argue it depends on your background. Objective-C and Swift have quite a few differences. A lot of people learn a script language like Javascript first, and if that's your background, Objective-C could have more to learn, as it's quite different. And while Objective-C may be used more in the corporate world, sure, due to legacy apps et. al., you'll still need to learn Swift to be able to work as an iOS developer. Although you could argue that Objective-C is enough to get you a job, and that you could later learn Swift at your workplace, which I suppose would be a fair enough argument.

You're right that Swift may be discouraging to new programmers as it's still rapidly evolving, although I think most people will be able to keep up, and if you know the basic fundamentals of Swift, you'll probably have but few problems adapting to the changes that are made to the language.

That said, perhaps you're right. Perhaps Objective-C would be the optimal language to learn first. I'm not sure. What does Pasan Premaratne think?