3 ms·
But null value seems to have the intent that it doesn't have category at all. So, let's say there's a function createFruit(fruitType: FruitTypeEnum); If it's
by mewpmewp2 2y ago
But null value seems to have the intent that it doesn't have category at all.
So, let's say there's a function createFruit(fruitType: FruitTypeEnum);
If it's null, it seems wrong since it seems to mean that you have a fruit without type.
If it's unknown, then it might also be incorrect, since you very well know the type, it just isn't handled there.
So I'm wondering if best might be something like Unhandled, Unspecified or Unlisted.
- dominicrose 2y agoI guess if you know the type but it's not in the enum, then you can save it somewhere else. If the enum changes afterwards, that data can be used to update the enum value.