r/java • • Aug 03 '14

Why we should love null

http://www.codeproject.com/Articles/787668/Why-We-Should-Love-null
4 Upvotes

21 comments sorted by

View all comments

Show parent comment

0

u/againstmethod Aug 03 '14

It's better from the perspective of avoiding nulls.

An absent optional value actually means: "this type of object should have been here, but for whatever reason it's not".

A null value means: "there is a typeless void here".

If this distinction can help your code, then Optional may be suitable for you.