3 ms·
"distinguish between things that should never be null and ... might not be present" My strategy is to use Enums. And no autoboxing. And use NullObjects.
by specialist 11y ago
"distinguish between things that should never be null and ... might not be present"
My strategy is to use Enums. And no autoboxing. And use NullObjects.
- lmm 11y agoEnums don't have (dynamic) data members, do they? Sometimes you want a representation of e.g. "user's email address, or nothing if they haven't set one". More, you want that often enough that it's worth having a single generic way to represent it rather than having to construct a custom NullObject for each case.