News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by masklinn on Monday June 17, 2013 @01:35PM (#5894563)
> What happens when you need an "else" branch?

Then you use one, but null checks generally aren't cases of if/else conditionals, they're more along the lines of "either I have one or mayday mayday". Sometimes slightly softened into "either I have one or use this default thing"

Re:Avoid Null Checks by Replacing Finders with Tellers by tbrownaw on Monday June 17, 2013 @02:09PM (#5894816)
more along the lines of "either I have one or mayday mayday".

That would be the Perl way of

    my $person = $data_source->get_person($id) or die "No person available";
ie, there's code to be executed (to raise the error) in the case that there is no person. The callback structure from the article doesn't allow for this.