Skip to content

Instantly share code, notes, and snippets.

@todgru
Last active May 15, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todgru/2f9fe6223ff5040dab6f92ecd226ac0b to your computer and use it in GitHub Desktop.
Save todgru/2f9fe6223ff5040dab6f92ecd226ac0b to your computer and use it in GitHub Desktop.
software guideline principles for a lazy programmer

Principles for lazy programmers

ongoing list that is sure to change.

setting: you can't show someone the light if they don't open their eyes. know when to shutup.

  1. single responsibility
  2. well written code should make tests easy to write
  3. explicit is better than implicit, except when its not
  4. YAGNI (You Aren't Gonna Need It)
    • DO NOT PREMATURELY OPTIMIZE,
    • do not solve future problems that don't exist now
    • do as little as possible
  5. KISS (Keep It Simple)
  6. DRY (Don't Repeat Yourself)
  7. Incremental Development - this simplifies verification, easier cognitive load
  8. Loose Coupling - two or more components are coupled with what they know about each other. the less they know about each other, the better - loosely coupled
  9. High Cohesion - that degree the grouped elements belong together, the higher the cohesion of the group, the easier to understand structure

side notes:

  • avoid mutation
  • favor pure functions - given same input, always returns same output. no side effects like ref/return non-local variables, mutations, io streams

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