News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by robotresearcher on Monday June 17, 2013 @01:14PM (#5894425)
An idiomatic Java/C++ OO approach is to have an interface to the datastore that eliminates the need for the NULL. That way you don't need to know the internal details of the datastore object.

datastore.ChangePhone( personId, number );

could return a bool to indicate success/failure or throw a "personId not found" exception according to taste.

This is normal Java style and is in line with the article's recommended "tell-don't-get" approach.

Requires boilerplate inside datastore object, but hey, that's not exactly news for OO.

Re:Avoid Null Checks by Replacing Finders with Tellers by ajanuary on Monday June 17, 2013 @04:17PM (#5895663)
OO doesn't mean boilerplate. Just because there's a correlation in languages like C++ and Java doesn't mean there's causation. Most of their boilerplate derive from the type system.