Defensive coding