News for hackers. Stuff that matters.
Re:Swift Changes Considered Harmful by dep_b on Sunday February 19, 2017 @12:40PM (#13680801)
I had a bad time going from 2 to 3. The renamification was pretty smooth but took a few hours of work for a big project. However there were more subtle differences.

Example code:

    var rowID: Int! // Set elsewhere, keeping it short. Also would never declare anything in this way but legacy

    func someFunc() {
        let updateUrl = "things/\(rowID).json"
        print("updateUrl")
    }

The result in Swift 2:

    things/123.json
The result in Swift 3:

    things/Optional(123).json
A ton of subtle bugs not detected by the compiler. Apparently Swift 4 will throw a warning for parsing an optional in a string but this was pretty bad. However I trust the change between 3 and 4 will be less breaking and will bring true or almost ABI stability. Between the 1.x versions and the migration to 2 was already more difficult than the 2 to 3 migration if it wasn't for the renamification and I still consider that a great thing.

I would still happily start a project in Objective-C(++) if I would need to integrate a lot of libraries that rely on O-C, C or C++. But Swift is the default for me.

There are no comments on this comment yet.