Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created March 22, 2014 18:09
Show Gist options
  • Save dreamr/9711694 to your computer and use it in GitHub Desktop.
Save dreamr/9711694 to your computer and use it in GitHub Desktop.
The rules and principles I try to follow
* Keep methods rediculously short
* Methods should do 1 thing
* Be idempotent when at all possible
* Leave objects open to extension, but closed to modification
* Don't modify objects unless constrained by memory operations
* Wrap Network and Disk and Database calls with encapsulation
* Dont mock what you dont own
* Write real unit tests, test inside the boundaries
* Write common path itegration tests, test the boundaries themselves
* Prefer Objects to Methods
* Prefer Functions to Methods
* Prefer stateless Modules to Classes
* Prefer stand alone modules to mix-ins
* Prefer explicitness to implicitness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment