Optional in Java and anti-patterns using it

Optional in Java and anti-patterns using it

5 years ago
Anonymous $fWzGa1uP8i

https://medium.com/@mervyn.mccreight/optional-in-java-and-anti-patterns-using-it-7d87038362ba

by Mervyn McCreight and Mehmet Emin Tok

In this article, we are going to talk about experiences we gathered while working with Java’s Optional-datatype, which has been introduced with Java 8. During our daily business, we encountered some “anti-patterns” we wanted to share. Our experience was that if you strictly avoid having those patterns in your code, chances are high that you will come to a cleaner solution.