IT lexicon › Programming › Defensive programming

Defensive programming

Programming På svenska → Updated: 2026-05-23

Coding style: assume all input is hostile, every API call fails, anything can return null.

Validate at every boundary, throw errors early, log unusual situations. Great at system boundaries, counter-productive internally (code becomes overloaded with checks). "Trust internal calls, validate at boundaries" is the modern consensus.

← Back to the lexicon