News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by dragonwriter on Monday June 17, 2013 @04:07PM (#5895590)
> Since it's a nasty dirty hack that tends to misbehave on bad data instead of failing cleanly

This assumes that an empty result set of a finder is "bad data"; there are times when this is true (in which case, the basic "teller" idiom as illustrated here isn't a good choice), but there are lots of times where it isn't, too.

Re:Avoid Null Checks by Replacing Finders with Tellers by tbrownaw on Monday June 17, 2013 @04:17PM (#5895662)
There's also the case where I forget a unique index or get the query wrong, and get several records when I'm only expecting one.
Re:Avoid Null Checks by Replacing Finders with Tellers by dragonwriter on Monday June 17, 2013 @04:22PM (#5895692)
The teller strategy can work for those; that's all checking that can be done in the teller (or, in the case of teller-implemented-on-top-of-finder) in the finder. There's no reason to repeat the logic checking for this case all over the application.