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

Paul Brazell
Paul Brazell
14,371 Points

Objective-C vs Swift

I am interested to know which is the better language to learn in terms of employment. I have started learning Swift and I am about halfway done with the course, and I really enjoy it, but when looking into job opportunities, a lot of them are wanting Objective-C developers. I really like Swift and that would be my language of choice if I was going to look first into doing freelance/develop my own apps, but I probably would have a better chance of making a good career out of programming by at least first starting with an organization.

So, is it better for me to continue my Swift 2 courses and then learn Objective-C afterwards? Should I pause Swift for now, learn Objective-C, then pick Swift back up as an extra skill? I want to have the skills employers are looking for, but I also don't want to spend a ton of time learning a language that will be phased out. Any advise?

2 Answers

Nathan Tallack
Nathan Tallack
22,159 Points

To reach a decent level of competency in Swift for iOS developement, you can't avoid learning enough Objective-C to consider yourself at least an "advanced beginnner" of Objective-C.

The reason for this is quite alot (read: almost all) of Apple's refrence materials for the various frameworks and librarires you will use are written with Objective-C code being exampled. So you will find that if you do not recognise the syntax and design principles of Objective-C the value you get from the refernece material is greatly reduced.

That being said, the learning curve is quite small. I knew only the basics of C when I learnt Swift, and then taught myself the basics of Objective-C (both through treehouse coursework and through external refrences) so that I could better understand Apple's reference materials for their frameworks and libraries.

I now know enough to read Objective-C. Sometimes I come across some syntax or design practices that I cannot immeediatly comprehend, but with a little effort I can get there. Once I know what is being done it is a simple matter for me to translate that into Swift for my code.

So, for work that you will be the original author of, you could get away with knowing just the basics of Objective-C and reading what needs to be read in order to translate that to your Swift projects.

For work that you will be colaborating on however, the story is totally different. You cannot contribute effectivly to a team project if everyone on the team is coding in Objective-C and you are coding in Swift. It would create risk from both sides of the fence, with you maybe not understanding or supporting the Objective-C source code and your associates maybe not understanding or supporting the Swift source code.

So, in summary. If you are coding your own original work or you are working with others who are coding in Swift, then you could get by with just a working basic knowledge of Objective-C. But if you are coding with teams that are already developing in Objective-C then you will need to be quite competent in Objective-C.

I hope this helps. :)

Paul Brazell
Paul Brazell
14,371 Points

So from what I am understanding it would be beneficial to learn objective c first then learn swift. I want to learn both just didn't know what would be a better order to learn them in from an employment perspective.

This answer is so much better than mine. I feel slightly ashamed.

Nathan Tallack
Nathan Tallack
22,159 Points

Paul, I did not learn Objecitve-C before I learnt Swift. And I did not feel handicapped. So getting through all the Swift courswork here on Treehouse is totally possible without knowing any Objective-C.

But once you want to move beyond the Treehouse Swift coursework and start reading Apple's developer references, you'll want to know Objective-C. So doing some (or even all) of the Objective-C coursework here on Treehouse would be a great benefit for that!

So, I think it does not matter which order. Just that it happens.

Mikis, your answer is equally valid and probalby better for all, less exhausting! :)

Haha thanks, I feel a little better.

Learn both, of course :) If you're forced to choose one though, then you have to prioritize your goals; set aside the employer/freelancer dilemma for a sec. What matters is whether you are going to ultimately be working on brand new apps or updating an older codebase. If it's the latter, then learn Objective-C; there are so many codebases out there that are written in Obj-C that the language won't be useless for quite a while. If it's the former, then learn Swift. Why? Because, Obj-C is dumb; like if I saw it on the street I'd beat the shit out of it for being so dumb. And Swift, in contrast, is soooo f***ing sexy. And like you said, it's hear to stay.