I think having null is great in some cases where you need to represent missing value. It’s just that there’s no good way to know for sure if you need to do null checks or not. The only way around it is to do null checks everywhere, which no one wants to do because fuck that. Nowadays there’s Optional which solves some of this, but it was introduced way too late.
If I were to redesign Java the first thing I would do is to add a nullable keyword or something.
I think having null is great in some cases where you need to represent missing value. It’s just that there’s no good way to know for sure if you need to do null checks or not. The only way around it is to do null checks everywhere, which no one wants to do because fuck that. Nowadays there’s Optional which solves some of this, but it was introduced way too late.
If I were to redesign Java the first thing I would do is to add a nullable keyword or something.
Option types or sum types would probably be a much less terrible choice for this, although I guess some sort of nullable keyword counts as a sum type