T2 No Escape Hatches Prickles
Briefly

T2 No Escape Hatches  Prickles
Null references and other escape-hatch constructs allow invalid states to pass type checking and reach production. A null reference admitted by the type system can be shipped repeatedly, and the silent escape hatch can cause large-scale production failures. Type systems can be used as syntactic methods for proving the absence of certain program behaviors, but any mechanism that withdraws the proof undermines that guarantee. In TypeScript, the introduction of unknown as a safer alternative to any reflects an effort to replace the original escape hatch with a typed mechanism that forces narrowing before use. Subsequent releases further tighten rules to reduce silent failure modes and require explicit handling.
"Tony Hoare called his 1965 invention of the null reference his "billion-dollar mistake" for exactly this reason: a type that admitted the bad case shipped the bad case every time, and the escape hatch - the silent null - cost the industry a billion dollars in production failures."
"Benjamin Pierce's Types and Programming Languages (2002) gave the academic statement: a type system is a syntactic method for proving the absence of certain program behaviours. any withdraws the proof."
"Hejlsberg framed the new type as "the safe any" - explicit acknowledgement that the team had been losing the fight against the original escape hatch and now needed a typed replacement that forced narrowing before use. Every TypeScript release since has tightened the rule from the language side: noUncheckedIndexedAccess (4.1), exactOptionalPropertyTypes (4.4), verbatimModuleSyntax (5.0)."
"The language is doing the work of saying: don't silence me."
Read at Prickles
Unable to calculate read time
[
|
]