2 ms·
The thing with type erasure is that reflection is a big part of Java - but it doesn’t work too well with generics. With optionals, I had hoped they would be a
by doctor_eval 2y ago
The thing with type erasure is that reflection is a big part of Java - but it doesn’t work too well with generics.
With optionals, I had hoped they would be a huge benefit to catching potential NPEs at compile time. But it was just lipstick. It was half assed. The reasoning was as you say - telling the caller about nulls - but IMO it adds complexity without benefit. They could have just defined a standard annotation. Or… made the compiler enforce them.