3 ms·
java is on a great trajectory now. it gets big updates. they know where they are missing on features. even without nullable types you have optional. it’s a grea
by foolfoolz 2y ago
java is on a great trajectory now. it gets big updates. they know where they are missing on features. even without nullable types you have optional. it’s a great language for any project.
- vips7L 2y agoOptional is not good at all. It is not enforced by the compiler and optional itself can be null. In hot loops it can allocate like crazy. We need compiler support to enforce nullability and to get null into the type system.
- samus 2y agoIn a codebase heavily reliant on Optional it can be worthwhile to install NullAway just for the benefit of banishing that particular source of null. That doesn't help with dependencies of course (unless you are certain they also use a nullability checker), and calls to those will have to be wrapped with your favorite `null -> Optional.empty()` helper function. The pain with allocation is temporary. It is one of the candidates to become value types.