Re:Overhead of Returning Optional Values in Java and Rust
by vbezhenar on Saturday October 16, 2021 @01:50PM
(#28889812)
Java Optional is not a general replacement for nulls (although people might use it this way). It's a way to replace nulls in method return value, when those nulls indicate missing value. It's a subtle philosophical distinction, but I think that it's worth to remember it.
If you want to improve nulls handling in Java, you should use @NotNull annotation and corresponding linters.
If you want to improve nulls handling in Java, you should use @NotNull annotation and corresponding linters.
https://stackoverflow.com/a/26328555/315129