2 ms·
Not exactly. I use Guava's Optional frequently when writing Java. It really helps take care of the null problem. It doesn't change the language significantly. H
by krschultz 12y ago
Not exactly. I use Guava's Optional frequently when writing Java. It really helps take care of the null problem. It doesn't change the language significantly. However, I really wish it was part of the language instead of a library. Other libraries typically don't return Optionals which forces me to add even more lines of code protecting against nulls.
edit: s/Java/Android Java/, unfortunately the spat between Oracle & Google has prevented most of Java 7 & all of Java 8 from being incorporated into Android Java, which is what I work with on a daily basis.
- Niten 12y agoFor what it's worth: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html https://docs.oracle.com/javase/8/docs/api/java/util/Optional...
- rcconf 12y agoOptionals are part of Java 8.
- anthony_d 12y agoIt's in Java 8. java.util.Optional<T> Still a library but at least it's part of the standard library.