Skip to content

Instantly share code, notes, and snippets.

@hxtree
Created December 12, 2022 18:04
Show Gist options
  • Save hxtree/f9762c57ea39b13dcd36f5fad7ddfe14 to your computer and use it in GitHub Desktop.
Save hxtree/f9762c57ea39b13dcd36f5fad7ddfe14 to your computer and use it in GitHub Desktop.
Three Rules of Three

"Three Rules of Three":

  1. It is three times as difficult to build reusable components as single use components, and
  2. A reusable component should be tried out in three different applications before it will be sufficiently general to accept into a reuse library.
  3. Two instances of similar code do not require refactoring, but when similar code is used three times, it should be extracted into a new procedure.

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment