Code accretes because reality keeps delivering requirements nobody wrote down. The damage from this comes when the code is the only record of why, and the way out is to recover that specification, sort the promises from the accidents, and give each requirement you keep a name and a record of its own.
Rasmus Ros wrote "From Stringly to Strongly Typed," an article describing a Kotlin library that solves one half of typed schema access: how to read the data. But data isn't just accessible; it's related to other data, and that half he's deferring to a future post. The deferred half is well-trodden ground, and the reasons we don't tread it are worth knowing.
In F-Bounded Polymorphism: Type-Safe Builders in Java , author fbounded addresses what he calls a fundamental inheritance problem in Java's fluent builder pattern. When a base builder class returns...