Get rid of deep null checks

added by Paul Wheeler
3/27/2014 2:08:22 PM

1 Kicks, 119 Views

The goal is to retrieve (or compute) a value, but in order to do that, we have to get through many intermediate objects, which could be in a default state. Sometimes, along the way, there are additional method calls, “as” conversions or collections. We have to handle properly each of them, which bloats further the code, making it less readable. There’s got to be a better way.