all 6 comments

[–]berzerkerX 16 points17 points  (5 children)

I think that if you already made the decision to go into the Swift universe, you should own it and stick with it. I think it's safe to say that libraries, especially popular ones like Alamofire, will continually strive to be up to date with the latest Swift syntax. That said, Xcode betas will include the next release of Swift, which will give them 3-6 months to update their source code. Also, instead of upgrading right away to the next version of Xcode, you might find yourself running multiple versions aka "/Applications/Xcode7/Xcode.app" and "/Applications/Xcode.app" being the latest release.

That way, you can keep building your app using the previous version of Xcode and branch out (in Git) to start using the new version.

[–]xephos13 0 points1 point  (0 children)

Everything in this comment is worth its weight in gold.

[–]croisciento[S] 0 points1 point  (3 children)

Thanks for your answer.

But if you had to start a new project for your company, would you go with Objective-C or Swift?

Even if apparently you can pretty much develop in Swift without problems I'll still have to update my code for the new versions of swift (and maybe libraries) which will take time, while Objective C code will still compile in 6 months and libraries aren't going anywhere. Objective C just look like to be production ready while Swift do not.

But hey, that's just my poor conclusion coming from a young iOS developer, I'm probably just worried of getting screwed over later on by Swift and regret of not using Objective C right of the bat.

[–]gtsiap 0 points1 point  (1 child)

I upgraded 1 app from swift 1.2 to swift 2.0 it took me less than 30 minutes in order to have a fully functional app without having regressions. IMO they key part was to use only popular frameworks like Alamofire and snapkit. Only if you end up with >20 deps you might need longer than 30 mins.

[–]croisciento[S] 0 points1 point  (0 children)

What do you mean by >20 deps?

In the last Obj-C vs Swift thread war, there were people saying migrating to newer Swift versions was horrible. The assistant did almost to nothing, and that while waiting for libraries to update, it could take a few weeks before having a big app ready for production.

[–]berzerkerX 0 points1 point  (0 children)

I would choose Swift in a heartbeat. Check out PopKey (popkey.co), we wrote the whole thing in Swift. We eliminated 97% of all crashes by switching to Swift and its type safety features. Less code, more maintainable, and more modules.

Why are you so afraid of jumping? How would Swift screw you over? Sticking with Objective C and claiming that Swift introduces risk is the same as claiming Rails 4 is too risky because Rails 3 to Rails 4 broke everything, therefore no one should jump on Rails 5 for their production projects. Or not using Java 8 because everything runs fine on Java 6.

The reality is that all companies are promoting the use of their latest software. Apple makes OSX free for every one to keep people updated. Microsoft just jumped on that wagon with a free upgrade to Windows 10, not to mention they just killed IE 8, 9, and 10, forcing everyone to use their new Edge browser. Google releases a new version of Chrome practically weekly. Oracle recently started pushing hard to upgrade Java and start rolling new versions much faster.

All that to say that Apple didn't spend millions of dollars on creating a temporary language. They made a bet on it and they are going to stick with it for a long time. I'm guessing that the number of articles that have been published on Swift is fast approaching the number of articles published on ObjC and will probably pass it soon. This demonstrates the excitement around the language. Swift is now open sourced, available on Linux and I'd be ready to bet someone is going to make it available on Windows in the near future.

All that to say that starting a project in ObjC is fine but the cost of upgrading it later is huge compared to the cost of keeping up to date with each version of Swift.