Programs must be written for people to read, and only incidentally for machines to execute.
-Abelson & Sussman, Structure and Interpretation of Computer Programs
- Purpose: describes what a function does
- Contract: states the argument types and the returned value type
- Examples: self-explanatory
- Definition: the function signature but in a comment - yes, very redundant and a garbage practice
- Tests: set of function calls with expected return values