React Native
Ask HN: Swift or Objective-C for new iOS app in 2017?
21–30 of 33 posts
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#22Objective-C is a dead end. Swift.
Not 100% true. There are tons of apps in Objective-C that have been around for years and the support continues.
Also Apple is very clear about that in their documentation.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#23Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#24Maybe Obj C if your machine is a bit old or underpowered. SourceKitService is a hungry, hungry little beast. The tooling in general around swift still feels a bit "in progress" imo but it's defo the future, and for me, the present.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#25Also note that it's trivial to manually convert small blocks and idioms from Objective-C to Swift.
And that you can include Objective-C libraries and classes/files and call them from Swift.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#26I absolutely adored Objective-C. But there were a few things I never felt comfortable with and just drank the Kool-Aid on.
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.
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.
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.
4. It's going to be very good to know this language in 2 years. Javascript has owned the browser for too long.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#271) 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
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
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.)
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.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#28Swift - Do I want to attract young developers in a near future? Do I value awesome user interface over app stability?
Objective-c - Am I looking to collaborate with Sr. developers? Do I need tones of support and documentation on the Web?
Other than that, it really doesn't matter even in 2017.
Re: Ask HN: Swift or Objective-C for new iOS app in 2017?
#29Maybe Obj C if your machine is a bit old or underpowered. SourceKitService is a hungry, hungry little beast. The tooling in general around swift still feels a bit "in progress" imo but it's defo the future, and for me, the present.
I can't agree with this rationale. Your machine will change over the years, while decisions as important as the programming language to choose will remain over time.