3 ms·
Many of those booleans aren't necessarily named. Any "is(n't) null" check on a nullable includes a boolean expression. That's quite a few booleans right there.
by mdpye 5y ago
Many of those booleans aren't necessarily named.
Any "is(n't) null" check on a nullable includes a boolean expression. That's quite a few booleans right there.
Using an optional (and accessing it with either fmap or a match expression) removes the value from the scope of the "wasn't present" branch, eliminating a possible source of mistakes.
Using an optional with an isPresent test does not. And you see that boolean pop up again in the return of that method. I think that's what they're getting at.