Re:Why many developers still prefer Objective-C to Swift
by dep_b on Saturday October 07, 2017 @07:03AM
(#15423293)
Type all of your more complex statements and block parameters, especially when you're chaining complex stuff. It's much easier to verify that the types you've stated are correct than to calculate all the possibilities that a type might have.
Re:Why many developers still prefer Objective-C to Swift
by steeve on Saturday October 07, 2017 @06:57AM
(#15423275)
I'm kind of sad this flag exists to be honest....
Re:Why many developers still prefer Objective-C to Swift
by kobeya on Saturday October 07, 2017 @12:29PM
(#15424406)
400ms is about a billion clock cycles. If it takes a billion clock cycles to type check an expression, something is very very wrong.
Re:Why many developers still prefer Objective-C to Swift
by andrewmcwatters on Saturday October 07, 2017 @10:38AM
(#15423929)
1. Sounds pretty sane. 2. is tragic.
1. Use modules.
2. In Xcode, go to your target, go to Build Settings, and at Other Swift Flags, add the following flags: -Xfrontend -warn-long-expression-type-checking=400
This will issue a warning when the Swift compiler takes more than 400ms when deducing the type for a particular expression. If you get no warnings, lower to 300, and if necessary to 200.
Anyone have other tips?