Skip to content

Instantly share code, notes, and snippets.

@todgru todgru/principles.md
Last active May 15, 2020

Embed
What would you like to do?
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
You can’t perform that action at this time.