Skip to content

Instantly share code, notes, and snippets.

Software Proverbs

  • Clear is better than clever. --Rob Pike
  • Software engineering is what happens to programming when you add time and other programmers. --Russ Cox
  • Programs must be written for people to read, and only incidentally for machines to execute. --Hal Abelson and Gerald Sussman
  • The most important skill for a programmer is the ability to effectively communicate ideas. --Gaston Jorquera
  • Design is the art of arranging code to work today, and be changeable forever. --Sandi Metz
  • If it’s a core business function — do it yourself, no matter what. --Joel Spolsky
  • Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it --Brian Kernighan
@aguy
aguy / include.sh
Created April 11, 2012 14:49
shell script trap functions
#!/bin/bash
set -o errexit # exit on errors
set -o nounset # exit on use of uninitialized variable
set -o errtrace # inherits trap on ERR in function and subshell
trap 'traperror $? $LINENO $BASH_LINENO "$BASH_COMMAND" $(printf "::%s" ${FUNCNAME[@]:-})' ERR
trap 'trapexit $? $LINENO' EXIT
function trapexit() {