Skip to content

Files

Latest commit

16c4c14 · Aug 13, 2013

History

History
26 lines (17 loc) · 679 Bytes

defensive_style.md

File metadata and controls

26 lines (17 loc) · 679 Bytes

Defensive Programming

.fx: quote

A form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software.

Defensive programming techniques are used especially when a piece of software could be misused mischievously or inadvertently to catastrophic effect.

Defensive Programming


Guidelines

  • Every line of code is a liability
  • Codify your assumptions
  • Executable documentation is preferable

Python tools

  • Asserts
  • Logging
  • Unit tests