3 ms·
Can’t disagree more. Solution 1 just presents risk that some calls getUser() without doing the log in check. Then what happens? It is false that getUser being
by cowsandmilk 3y ago
Can’t disagree more. Solution 1 just presents risk that some calls getUser() without doing the log in check. Then what happens?
It is false that getUser being a “maybe function” forces the other functions like getFriends to be maybe functions. Don’t let them take null in their arguments. Force the caller to deal with the null when it is returned by getUser.