Hacker News new | ask | show | jobs
by yoz-y 3565 days ago
Until now Swift has not promised source compatibility so the developers should be ready to rewrite their code for new versions. I would not be surprised if Swift 2.3 support were dropped in the next version of XCode completely.

The migration tools are quite good though so going from 2.2 to 3.0 directly should not be much of a problem.

I think that in Python the problem was/is that the 2.x was already a massively used and mature language when the 3 came out.

2 comments

External librairies can also support the migration by providing "fix-its" which helps the compiler display an helpful message whenever a Swift 2-era line has not been updated to Swift 3 (see for example this PR: https://github.com/groue/GRDB.swift/pull/114)
The conversion tools failed pretty badly in my case. I had to do a ton of manual fixes. There are also still a lot of libraries out there that haven't updated yet so unfortunately I'm holding off on updating for now.
For us it worked quite fine for macOS but not for iOS targets. It also changed the function names for a lot @IBAction functions but did not update the connection in the interface builder. So now I have to a lot of testing to make sure all buttons work.

Still I have to admit it shows quite courage (get it?) to change so many things but naming is important and I see it positively. Only if Apple would use version numbers for Swift that would fit to the state, if you have that kind of fast update cycle and that many breaking changes a version number below 1.0 would have been better for Swift 1 and 2.

It is not perfect, but I would say it handled maybe 80% of stuff by itself. The one thing it could not solve for me was notification handling.