Hacker News new | ask | show | jobs
by sanderjd 3876 days ago
In languages with good type-checking and optional / maybe types (like Swift, Scala, Rust, Haskell, …), the null object pattern seems less useful, because the compiler makes sure you unwrap things in the right places. But the null object pattern seems really useful in languages like Ruby and Python, where attempting to use optionals tends to just replace null object errors with errors from forgetting to unwrap the value.