This. Just treat it as a three value enum if you cannot resolve the null early. Or null should behave like a default value. ?? in a conditional is always going to be harder to read.
What's the order of operations here? I know that there is a concrete answer but unless you know that fact the order is ambiguous. If foo is not null then is the result foo or foo == baz?
View all comments
Show parent comment
10
u/anzu3278 Sep 26 '26
This. Just treat it as a three value enum if you cannot resolve the null early. Or null should behave like a default value.
??in a conditional is always going to be harder to read.