~ read.
Functions: The Right Way

Functions: The Right Way

Every function or piece of code should have one entry point (input) and one exit point (output). – Edsger W. Dijkstra.

About the implementation.

  • Do one thing. Be Small.
  • One level of abstraction per function.
  • One level of indentation per function.

About the interface.

  • One or two arguments is nice, never more than three.
  • Never flags arguments.

About the workflow.

  • Sort function from high level to low level.
  • Warning with wreck train (don't talk to strangers).