Skip to content

Encapsulation

Motivation

A verified invariant is only durable if external code cannot reach in and break it after construction, which convention cannot prevent at scale. TypeScript's access modifiers turn information hiding from a discipline-based convention into a language-enforced boundary, hiding the parts of the design most likely to change.