Skip to content

Instantly share code, notes, and snippets.

@Soulflare3
Forked from lyoshenka/coding_maxims.md
Created January 14, 2018 12:05
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 Soulflare3/719a777483c5feffdbc1ddbdce9fd0f5 to your computer and use it in GitHub Desktop.
Save Soulflare3/719a777483c5feffdbc1ddbdce9fd0f5 to your computer and use it in GitHub Desktop.
Keep this in mind when coding

Coding Maxims

  • code is debt (and bad code is a unhedged call option)

    • cant have 0-days or bugs if I dont write any code
    • our users dont care about the code
    • every line of code has costs (your time, readability, maintainability, complexity)
      • its like owning a house with lots of rooms. its nice when your friends come over once a month, but you pay rent every day
    • dont add features unless you're sure it is necessary
    • dont optimize prematurely
  • DRY DRY DRY

  • keep it simple (especially at first)

  • be consistent

  • be predictable (aka no magic)

  • no magic numbers/strings — use constants instead

  • a good repro is 90% of a bugfix

  • code is written once, but is read many times

  • ship early, ship often

  • first code, then ship, then measure, then optimize

  • remember the 80/20 rule, and the 90/90 rule

  • first you don't know the rules, then you learn the rules, then you break the rules

See also: https://en.wikipedia.org/wiki/Category:Programming_principles

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