r/iOSProgramming • • Apr 26 '16
Question Swift or Objective-C for new app development?
[deleted] — view deleted post
0
Upvotes
r/iOSProgramming • • Apr 26 '16
[deleted] — view deleted post
6
u/systemsock Apr 26 '16
Swift, it's what the ecosystem is moving towards.
It's still good to know some Obj-C for legacy purposes.
2
u/lucasvandongen Apr 26 '16
I never hated working in Objective-C like some people but I never really saw much use for the dynamic aspects of the language either, so when Swift came along I jumped the bandwagon around the Swift 2 betas in Xcode.
The hardest part learning to develop for iOS never was the language but the SDK's, async programming, weird background app rules and so on. This knowledge stays with you in the transition to Swift.
It's OK if you will write Swiftified Objective-C in the beginning, there are a lot of new patterns to use and abuse in Swift but you don't need to use them to get from A to B with your app.
2
u/TheSteveOfLegend Apr 26 '16
Subjectively : Swift. I'm in the 'never liked ObjC' camp and haven't touched it since it the first Swift release. I'm far more productive in Swift. It's a much better fit for how I think about code than ObjC. I for one look forward to the utopian future where I never have to type import Foundation or use anything with an NS prefix ever again.
Objectively : It depends. What 'C like' languages have you worked in? If it's actual C you may be more productive in ObjC as it's a strict superset (though I never found that warmed me to it as a long time C programmer). If it's Java or C#, then Swift is probably a closer match. If you want to use leading edge APIs, most sample code and all the WWDC stuff is in Swift. Block based API (almost anything recent) use is far easier in Swift - ObjC's block syntax is a crawling horror. Big drawback productivity wise is that XCode still can't refactor Swift (but WWDC is just around the corner and we can hope). Swift is evolving faster than ObjC, which may or may not be a plus, YMMV, but it's way more of a community driven effort than ObjC will ever be.
But TBH, as someone mentioned up thread, you'll likely spend more time figuring out the API and system conventions than you will on actually learning the language.
2
u/tylerjames Apr 26 '16
I think at this point, as long as you're not working on an established Objective C app, that you should go ahead with Swift.
It's not hard to see what direction the wind is blowing at this point. The Swift ecosystem is exciting, it's maturing rapidly, it has a lot of very active enthusiasts.
A year or two ago one could have said that most of the materials out there for reference were related to Objective C, but that tide is turning significantly. It seems like some people make a career on Stack Overflow of providing Swift answers to Objective C questions. Most new tutorial materials are either entirely Swift or will include both Swift and Objective C.
I would say the main downside right now is that Xcode is shit with Swift compared to Objective C. But it's getting better and it will only continue to do so.
1
u/[deleted] Apr 26 '16
Ok either case you're going to have to learn. If you want to learn a lot go for Swift. If you actually want to create something and learn something in the process go for Objective-C.
0
u/[deleted] Apr 26 '16
[deleted] — view deleted comment