Firewall Code
Noun · Development · Origin: 1985
Definitions
Code written specifically to guard against conditions that should be impossible, forming a barrier between a trusted region of a program and everything else. Firewall code checks invariants the surrounding logic already claims to guarantee, on the theory that the guarantee will eventually be violated by a caller nobody anticipated. It is distinct from ordinary validation in both intent and tone: the author does not expect the check to fire, and often logs loudly when it does. The term predates and is unrelated to network firewalls, though both share the metaphor of a barrier that contains damage rather than preventing its cause.