News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by flanbiscuit on Monday March 26, 2018 @09:59AM (#16678907)
I learned some Swift when it as at 1.2 and I'm happy to see it evolve so quickly and take common statements, like the optional unwrapping "very long `if let` statement" mentioned article, and simplify it. I really should get back into Swift.
Re:Avoid Else, Return Early (2013) by yoz-y on Monday March 26, 2018 @10:10AM (#16678999)
Swift also has the `defer` statement which makes this particular approach usable even if there is cleanup to do before the function can exit.