News for hackers. Stuff that matters.
Re:My most common code review suggestions by saltedmd5 on Thursday December 07, 2017 @08:27AM (#15869767)
The point is that returning an Optional gives you nothing above returning a null - in fact it increases complexity and makes calling code more error-prone for no gain.

If your contract says you return a Foo, you could be returning a null. If you change that to Optional<Foo> you could still be returning a null.

It's not what Optionals are for. They are just widely misunderstood and abused.

There are no comments on this comment yet.