Live data from Hacker News

Ask HN: If learning to develop for iOS- start with Obj C or Swift?

news.ycombinator.com

11–20 of 53 posts

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#12
I think you do have to learn a bit of the basics of Objective-C. The sole reason being that most of Apple's frameworks are currently written in Objective-C, as well as most tutorials and example material. You'd have an easier time converting Objective-C code to Swift code if you understand the basics of Objective-C. You'd also have an easier time finding solutions to problems on sites like StackOverflow, which already has a wealth of Obj-C questions and answers.

But in the end you don't have to become an Objective-C pro. Once you feel comfortable using the language, you could start focusing on Swift.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#13
Objective C. When you need to figure something out, and Google returns 1,000 tutorials on how to do it on Objective C and nothing for Swift, you'll know why.

Sure, Swift might be better. One day you'll probably learn it. But 99% of the effort in learning Objective C is learning all the frameworks and libraries, and the support to do that is much better in Objective C (at present).

If you already know Objective C, and a looking at starting a new project, Swift might be better. The lack of Swift-specific resources won't hurt, because you should be able to easily translate them from one to the other. But if you don't know either, I'd start with Obj-C.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#15

Swift. All the code will move to Swift eventually, I predict that new APIs won't even be callable anymore from Objective-C in the future. I'm going to write all my code in Swift from now on.

I highly doubt that actually. Swift is not a replacement. There will always be glue between Swift and platform and system APIs. Swift only interoperates with Objective-C and (to a limited extent) C and not C++ (and a lot of APIs in Apple world are exposed as C++ especially on the Mac). Swift uses ObjC blocks and can't even handle function pointers. Unless there is a dramatic shift in the design of Swift, I don't see the writing on the wall that Swift is out to kill Objective-C, only complement it.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#16
Short answer: Both.

Longer answer: Swift is the future, so if you have to pick exactly one of the two, pick Swift only. But Swift is, along some axes, an evolution of ObjC, and you will learn much by getting what you can from the wealth of ObjC/Cocoa/CocoaTouch material that's already out there, then applying it to Swift.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#17
Objective-C, though approach knowing that you'll switch to Swift.

The Swift tools aren't mature yet - on Friday I managed to get llvm to segfault on multiple parts of my codebase. Rewriting the same thing in slightly different syntax fixed it.

The code highlight/autocompletion service also crashes frequently, as does Xcode in response to certain pieces of valid code.

Not only that, the amount of Googling you can do with regards to any kind of problem is roughly zero right now. People are still figuring things out, so the amount of help you can get is very, very limited.

Once Google/Stackoverflow fills up more, and llvm stops fucking crashing on perfectly valid syntax, you can switch to Swift.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#18
I used to help teach the iOS Development class at NYU - I was having this conversation with the professor who's teaching it again next year and we talked about this specifically for new students.

I think that you should learn Swift because it is where most app development will be heading in the future and far easier to pick up than Objective-C. The main disadvantage currently is that the whole corpus of knowledge about iOS development is steeped in Objective-C. My advice is to learn Swift and develop in Swift, but know enough Objective-C to be able to translate it to Swift and read documentation written for Objective-C.

Eventually as the corpus of knowledge in iOS development grows for Swift, this won't be as much of an issue.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#19
This is a tough one. Swift is going to be the future of iOS development and very important. But at the same time I think Obj-C will allow you to explore all the existing source code that is out there without any problems. I'd say go with Obj-C and learn Swift in the future.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#20
post #7

Anecdotal evidence in favor of Objective-C (Swift wasn't around back then): at an early WWDC, a dev. who was completely unfamiliar with Objective-C finished his first Cocoa application during the "Intro to Cocoa" session, and spoke about his amazement during the feedback. Swift is way more complicated than Objective-C, even if the syntax may seem a lot more familiar if you're used to certain other languages. The reas…

So, basically - learn both.
Post reply on HN