4 ms·
Java is also advertised as "enterprise" language and it can't even encode in its type system that a piece of data can be missing. Or maybe it can, with Optional
by youerbt 7y ago
Java is also advertised as "enterprise" language and it can't even encode in its type system that a piece of data can be missing. Or maybe it can, with Optional<T>, thanks Haskell.
I can't tell I had less problems understanding magic container IoC stuff than most Haskell concepts.
- the_af 7y ago> maybe it can, with Optional<T> Not even that. Java's optionals are almost useless, needlessly verbose, you still don't have pattern matching, and there's also still null to contend with.
- tsimionescu 7y agoTo be pedantic, Java perfectly encodes the information that a piece of data can be missing - any type supports null as a valid value. What it can't do is encode the information that a piece of data CAN'T be missing.
- bspammer 7y agoTo be even more pedantic, Java's primitive types (int instead of Integer etc.) have this feature. They can't be null.