News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by dasil003 on Monday June 17, 2013 @04:11PM (#5895610)
Exceptions for null handling? I admit there's room for healthy debate about using exceptions for flow control in various situations, but for null handling it sounds like an absolute nightmare. Instead of considering null at each point it might occur in the code, you have to consider all the possible places a null value might be stacked above you.
Re:Avoid Null Checks by Replacing Finders with Tellers by NateDad on Monday June 17, 2013 @04:19PM (#5895673)
Exceptions for error handling... this is just error handling, that was my point. Returning a sentinel value (null) is just one (very suboptimal) way of handling an error.

Instead of dataSource.getPersonById(id) returning null, it could throw a NotFoundException. This is better because it's a specific error (as opposed to a MalformedIdException, for example).