Re: [swift-evolution] Failable Initializer Suggestion

2016-01-05 Thread Dennis Lysenko via swift-evolution
My initial stance several months ago was that initializers should throw instead of returning nil, but I've changed it as a result of the error handling rationale (same document as Chris linked). Specifically this section, taken from ErrorHandlingRationale.rst: Simple domain errors A simple

Re: [swift-evolution] Failable Initializer Suggestion

2016-01-04 Thread Thorsten Seitz via swift-evolution
+1 for keeping failable initializers. Error handling should be reserved for errors and not be used for control flow or logic. -Thorsten > Am 27.12.2015 um 18:11 schrieb Chris Lattner via swift-evolution > : > >> On Dec 27, 2015, at 5:22 AM, Manfred Lau via

Re: [swift-evolution] Failable Initializer Suggestion

2015-12-27 Thread Tino Heth via swift-evolution
> How do you guys think of that? Makes sense. Failable init has its roots in Objective-C, throws is a better fit for Swift — but it is not trivial to change all Cocoa class to throw instead of returning nil (at least in theory — most likely many classes don't have that many reasons for a