Hacker News new | ask | show | jobs
Should you start with Swift or Objective-C to learn iOS development? (candycode.io)
20 points by jure_z 4063 days ago
7 comments

Another thing to consider is what languages you already know, and whether Swift or Obj-C will have a lower learning curve.

My guess is that most people (trying to learn iOS) already know an imperative language, and the Obj-C will be easier. I'm really interested to find out if Swift is easier for complete beginners, who don't have preexisting programming experience. There are elements of it that look great (playgrounds being a prime example).

I believe that learning the Apple frameworks (and tools like IB) is going to constitute the majority of your time, regardless of which language you're calling them from.

Most iOS bloggers use Swift. Want to learn iOS 9 in 2 months? I bet most examples are in Swift. I've collected almost 1000 Swift articles in the past year.

http://www.h4labs.com/dev/ios/swift.html

Think Apple's demos at WWDC will in Swift, ObjC, or both? Apple doesn't do "legacy" for very long.

http://ericasadun.com/2015/04/14/swift-in-case-you-didnt-thi...

Exactly, Apple doesn't do legacy for very long.

To tackle the argument that there is infinitely more Obj-C resources out there - think of how many iOS3, 4 or even 5 tutorials you'd still be able to fully use and implement in your app? I'd say close to none. :)

That's one thing I should've mentioned as well, thanks!

I, for example, come from all sorts of different languages (C++, C#, Java ...) but Obj-C was still a pain to learn. I also do personal projects in Ruby, which I like a lot. That's why I'm really fond of Swift and I can see it going in a similar direction, maybe.

And I agree - Apple frameworks are still written in Obj-C, so you'll have to obtain a basic understanding of the language. But that can come in a bit later, once you've already built something and are looking to dig in a bit deeper. :)

I was in this situation last March. I had no native experience with only years of ruby and javascript under my belt.

I decided to begin my journey into the Apple world by starting with Objective-C. I made this decision because of the rich availability of learning resources, Stackoverflow's engaged community and the maturity of the language.

I moved over to Swift this January, and the transition couldn't have been better. I know I will take flack for this statement, because it isn't entirely true but: I feel like Objective-C and Swift are related to one another as Coffee-script is related to Javascript; so the time spent learning Objective-C was not wasted and only made my appreciation for Swift greater.

Of course, you definitely didn't waste time spent learning Obj-C - once you dig into more advanced stuff, you find that knowledge useful.

Although, I think that considering Swift is only around 7 months old, there are already a lot of really good and high quality resources available online.

Good point. This is now totally true. It was not the case last year when I had to make this decision. The resources available is rich today.
I don't know the correct answer but I fully agree with the autor: "The wrong answer to this question is learn both. You’re going to have a hard time simultaneously learning two programming languages with different syntax. You’re going to feel overwhelmed and chances are, you’re going to throw in the towel very soon."

So true.

I would qualify that and say "learn both but not at the same time." I found that it was only after I started learning my second programming language that I really started to appreciate many aspects of programming and understand which concepts are specific to languages and which others apply to programming in a broader sense.
"Swift is the more beautiful language and it lets you write pretty code and bring you joy"

If you think code is "beautiful" then you don't know what you're talking about. You're anthropomorphizing a list of instructions. It's functional, not beautiful.

Go out and watch a sunset, and then try to compare that to a list of instructions, or better yet, compare your wife's beauty to that of a list of instructions - I bet she won't appreciate the forced equivalence either.

I've been programming for 30 years, and for me there is no beauty in code except for what it produces. Is buggy code written in Swift still "beautiful"? This is why it's not good to spend so much time in front of a computer, if you start to think of list of instructions as "beautiful" then you've lost touch with reality.

I took C programming in college (10+ years ago) and from there on out, every language I encounter is so much easier based on the knowledge I've gained in C. I'm sure the same can be said about Objective C. It was considered somewhat of a high level language (or medium level) but now is a much more low level language.

Most of my college education is now really outdated with the exception of operating systems (mostly Linux command line) and C programming.

Start with Swift because it's easier. Move to Objective-C when you are ready for lower level hacking. It's the same trajectory we all followed: first learning BASIC, then doing some grovelling in assembly, then moving to something like C or pascal.
When Swift is done... there will be nothing it can't do that Objective-C can.

Swift is not going to be just the beginner language for Mac and iOS programming.... it is going to be THE language for them in a few years

Highly agree. It will grow mature in time (probably a lot faster than iOS did - 30 years) and will feature a lot of new and useful paradigms.
A completely different suggestion: Neither - learn C# and use Xamarin. Lower learning curve than both Swift and Objective-C, you can port your apps to other platforms more easily, and your new skill will be applicable across paradigms beyond iOS development.
1) Your app is now tied for life to a third-party vendor. 2) There's is a steep yearly licensing fee. (starting at 300 USD PER developer, PER platform). 3) Xamarin Forms is notoriously buggy if you're looking to also use it for cross-platform UI code. 4) It's debatable how much easier C# is to learn than Swift.
I wouldn't advice Xamarin to someone who wants to learn to write apps for iOS.

Xamarin in great but it makes most sense to use in a professional environment where a single app needs to be target at multiple platforms. Usually developers using Xamarin already have a great understanding of iOS and Android (and Windows?) before they start using Xamarin.

I think for someone new to developing apps it would be too much of an abstraction.

Well yeah, there are numerous different approaches one can take. You could also build hybrid apps if you're familiar with HTML&CSS, you could use RubyMotion if you're a Ruby dev, etc. :)
Lower learning curve than both Swift and Objective-C

I would have to see some evidence of that. Neither Swift nor Objective C have a particularly scary learning curve.