News for hackers. Stuff that matters.
Re:Avoid Null Checks by Replacing Finders with Tellers by fexl on Monday June 17, 2013 @05:17PM (#5896011)
The problem I have with his example is that I would probably want to do this:

    Person person = dataSource.getPersonById(personId);
    if (person != null) {
        person.setPhoneNumber(phoneNumber);
        dataSource.updatePerson(person);
    } else {
        user.notify("That's an invalid ID.");
    }
So I need an "else", in effect, regardless of whether it's implemented as a conditional, block, lambda, exception, or whatever.

There are no comments on this comment yet.