News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by anon1385 on Monday June 17, 2013 @02:19PM (#5894884)
Anybody know why this got flagged off the front page? http://hnrankings.info/5893950/
Re:Avoid Null Checks by Replacing Finders with Tellers by bfung on Monday June 17, 2013 @02:48PM (#5895105)
I don't know why, but take it as a signal that it this isn't as interesting to the HN community.

If you think about it, it's not avoiding null checks, it's just moving it to a different place. The null check still needs to happen in order to know when to call the block, it just happens to be in the datasource.whatever code.

Re:Avoid Null Checks by Replacing Finders with Tellers by masklinn on Monday June 17, 2013 @03:54PM (#5895509)
The point is to move the check out of the library user's way, and out of his ability to forget about it. Same as block-scoped resource patterns (RAII, context managers, unwind-protect, whatever).