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.
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"