At Armakuni we spend one day every fortnight away from client work to develop practices and the way we work. This week Tom Oram and I decided to investigate ways of using Java Optional to get the most value from it. The motivation for this exercise was based on our observation how Java Optional is often not used to the same level of usefulness compared to how it used in other languages — and of course to get a better taste of TDD and pair programming.
We not happy with how the Optional is used within Java the ecosystem
The lifetime of an
Optional value in Java seems to usually only exist in a limited scope before it is unboxed with an
orElse or similar. This is different to how this type is used in other languages (mostly functional) where the unboxing is deferred to the latest possible moment… Continue