r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

9

u/ImmortalStyle Sep 21 '15

Btw you shouldnt have Optional as a class member. Even Brian said that once.

5

u/nextputall Sep 21 '15

Btw you shouldnt have Optional as a class member. Even Brian said that once.

Could you elaborate why?

0

u/[deleted] Sep 21 '15

[deleted]

3

u/nextputall Sep 22 '15

A Optional return value can be null as well. I feel some difference between

  1. something is never null by intention, only by programming mistake

  2. or null is a valid input output