This question was asked a little over a year ago on HN and I noticed many answers said something along the lines of "Give swift another year". What do you think now?
Swift, since it's Apple's preferred language of the future. On Apple platforms, you pretty much should embrace whatever the Mothership prefers going forward.<p>Additionally, once you start coding in it, you'll likely find it's a joy compared to Obj-C.
I can think of only two reasons to use Obj-C over Swift in 2017:<p>1) The app will rely heavily on outside libraries or codebases that are Obj-C, to the extent that it will be annoying even though Swift-ObjC interop is pretty OK, and<p>2) You (or your developer(s)) are grizzled Obj-C veterans, haven't yet learned Swift, and you are in a rush and don't want to waste time learning stuff<p>Swift has some warts still, but the show-stoppers like "all your code will break in the next release" are over (well not on Linux yet, maybe, but on iOS for sure). Swift is better than Obj-C in almost every way you could think up, even if thinking them up was the whole point of a drinking game. (And I say that as somebody who did Obj-C programming for 19 years and Swift only 2 so far.)<p>So it's pretty much truck-vs-horse at this point. The horse will still let you ford that river after a flood, and you can eat it if you get trapped for weeks by a blizzard or something... but basically the truck is gonna be better for almost anything unless your app is really unusual.
Swift, unless:
1) You intend to keep this app maintained but can't afford to track future Swift languages changes, or
2) You want to optimise for binary size above all other considerations. (apps written in swift bundle the swift libraries)
I developed in Objective C for years. Have been on the Swift boat for a while now, and not long ago I did some maintenance on an old Obj C project.<p>Even allowing for the re-learning time and rustiness, there was such a sharp contrast. Swift is just so much more fluid, productive, expressive, and a joy to use.<p>Yep, there are plenty of issues, stability isn't 100%. Despite that, it is well worth the jump.
<i>Maybe</i> Obj C if your machine is a bit old or underpowered. SourceKitService is a hungry, hungry little beast.<p>The tooling in general around swift still feels a bit "in progress" imo but it's defo the future, and for me, the present.
Swift is simply a safer language to use, safer as in it tries to prevent you from shooting yourself in the foot. And at this point the framework support has pretty much caught up. So my vote is for Swift on new projects.<p>And stick with Swift 3.0
Hands down: Swift.<p>I absolutely adored Objective-C. But there were a few things I never felt comfortable with and just drank the Kool-Aid on.<p>1. Message passing to `nil`. Sure it's nice that you can safely pass a message to nil, but the idiom is a little weird. `guard` and `defer` have completely changed the way I write code in functions to exit safely.<p>2. Protocol Oriented Programming. This has changed the way I architect my applications for the better. I end up with less code over all and fewer Unit Tests in particular.<p>3. Associated Value Enums. Another big win over Objective-C. Now I can have a type and value all wrapped in one little package for my switch statements. It sounds minor, but it minimizes cyclomatic complexity.<p>4. It's going to be very good to know this language in 2 years. Javascript has owned the browser for too long.
Now that the language is more feature rich the rose tinted glasses have come off a bit. The dev experience can be slow even on a decent MacBook, and the language has its own gotchas if you deeply nest type inferences.<p>But it still beats Obj C by a longshot.
Definitely Swift. But:
1) If you plan to develop a SDK/lib compatible with both Obj-C and Swift and don't want to adapt to new Swift changes coming forward
or
2) You absolutely can't stand SourceKit related bugs in XCode happening now and then.<p>then consider Obj-C.<p>Would go pretty far to use Swift over Obj-C anyway, so I can deal with both 1) and 2) and still use Swift. It will just get better, so probably best to go Swift sooner than later.
Swift unless :
1/ you're working on a very big project ( 3/4 ios dev working on the app for a year full time)
And
2/ all the members of your team are already fluent with objc<p>Then, it's debatable, whether you bet on the swift tool suite to fix all the compiler crashes and compile time issues before your code base reaches the critical point.
I like Swift after using Objective-C for many years, and most agree. As others have said, I don't see much new code coming from Apple or anyone else in Objective-C.<p>Also note that it's trivial to manually convert small blocks and idioms from Objective-C to Swift.<p>And that you can include Objective-C libraries and classes/files and call them from Swift.
There is no good or bad answer. Here is how I'd pick a language:<p>Swift
- Do I want to attract young developers in a near future? Do I value awesome user interface over app stability?<p>Objective-c
- Am I looking to collaborate with Sr. developers? Do I need tones of support and documentation on the Web?<p>Other than that, it really doesn't matter even in 2017.
I am still coding with Objective-C for production apps. Random SourceKit crash on Xcode causing auto-complete to go haywire impede productivity especially you are in the flow.<p>And to adapt to new syntax whenever a new Swift version come out... is painful
Not just swift, specifically Swift 3.0 since it will stay stable. Some libraries haven't caught up but worst case you spend three hours manually updating lines the converter couldn't figure out.
Swift for your own code. Choose ObjC for any 3rd-party frameworks and libraries otherwise you risk being stuck waiting for them to be fixed when swift is upgraded.