Code should be designed like a M&M.

8th Light University Facing Failure

Ultimately this is related to separation of concerns. This imagines a program as a M&M With the center being what you want the code to do and the candy shell handling the connection outside world, this includes security, data access, and error handling.