2013-09-03 00:14 időpontban David Deutsch ezt írta:
"Roundcube, code proudly cleant by argumenting trolls"
For what it's worth, I found it pretty funny, so: I'll take it! ;-)
For that specific "entire content of a function" case I mentioned the exceptions that allow returns at the beginning of a function that check preconditions.
True, and that is indeed a good example that you're citing. I still think my version is easier to understand, but hey - I did the work on it, so it might as well just be confirmation bias ;-)
I think that the maybe-best implementation is:
function foo() { $return = null;
if (expr)
{
[...]
$return = $something;
}
return $return;
}