TLDR Web Dev · LAUNCHES & TOOLS
OMITTABLE — SOLVING THE AMBIGUITY OF NULL
Summary from the TLDR Web Dev newsletter
In Java, the concept of null is ambiguously used to represent both a value and the absence of a value, causing issues in scenarios like partial updates or filtering, where distinguishing between a missing field and a null value is crucial. While Java's `Optional` type aims to address this, it falls short because it cannot represent the explicit null value. The `Omittable` library for Java and Kotlin introduces a container type that distinguishes between a value and the absence of a value without using null as a sentinel, providing a clearer way to handle optional data.