▲ | stux a day ago | |||||||||||||||||||||||||
This is interesting! A field being nullable because it's legitimately optional in the domain model is one thing, but for new fields which shouldn't be nullable in the domain model, unless you can pick a reasonable identity value, you need a concept of absence that's different from null. Luckily the intersection of "non-nullable fields" and "fields with no reasonable identity value" and "fields which didnt exist in v1 of the domain model" is normally pretty small, but it's painful when it happens. This reminds me of frozen/nonfrozen enums in Swift. You can do exhaustive case analysis on frozen enums, but case analysis on nonfrozen enums requires adding an `@unknown default` case. https://docs.swift.org/swift-book/documentation/the-swift-pr... | ||||||||||||||||||||||||||
▲ | nlitened 16 hours ago | parent [-] | |||||||||||||||||||||||||
> you need a concept of absence that's different from null Could you give an example? Null _is_ absence, the way I see it | ||||||||||||||||||||||||||
|