Springs are Optional
by in Representative Line on 2025-08-28Optional types are an attempt to patch the "billion dollar mistake". When you don't know if you have a value or not, you wrap it in an Optional
, which ensures that there is a value (the Optional
itself), thus avoiding null reference exceptions. Then you can query the Optional
to see if there is a real value or not.
This is all fine and good, and can cut down on some bugs. Good implementations are loaded with convenience methods which make it easy to work on the optionals.