init? vs. init throws: http://mjtsai.com/blog/2015/07/23/failable-init-vs-throws/ …
-
-
@mjtsai I think that’s directly analogous to ObjC—initializers that return nil are always improved by adding an …error: argument.0 replies 0 retweets 0 likes -
@optshiftk Right, but in Objective-C that doesn’t really affect the callsite.0 replies 0 retweets 1 like -
@mjtsai Adding an …error: argument does affect the callsite.0 replies 0 retweets 0 likes -
@optshiftk The caller can just pass NULL if it doesn’t care. Nothing else changes. With Swift, the caller has to add do-catch blocks.0 replies 0 retweets 0 likes -
@mjtsai Or the caller can prefix with `try!`. Either way, it’s a forced change at the callsite.0 replies 0 retweets 0 likes
@optshiftk “try!” doesn’t mean “I don’t care about the error details.” It means “I know this will succeed, so crash if it doesn’t.”
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Michael Tsai
Kyle S.