Defensive Programming 4th Core Principle
The fourth principle of defensive programming addresses a common issue: the mutability of a program's states, which can lead to unforeseen security bugs. Often, a program's state is mutable due to coding convenience. However, this convenience comes at the heavy cost of security vulnerabilities. We will first formalise this issue, then define the principle, followed by two implementation techniques.