4 Rules of Simple Design within the programming context

Pass All Tests

  • Unit testing. (In the future)
    • Run in an automated fashion
    • Reducing the feedback loop

Reveal Intention

  • Objective is to get something to work, error free, maintainable, sustainable, and that other developers can understand what you are diong and why you are doing it the way you are doing.
  • MIndset, others will look at your code in the future.
  • Code is read more than it is written
  • Method
    • Be Expressive
      • once you have something working, go through your code again and make it easier to read
      • More code is spent reading code and modifying it, than writing it.
      • You want to be able to read code as a story.
    • Choose a good name
    • Make things smaller
      • The smaller it is, the easier it is to understand what is going on.
    • Fewest elements
    • Simplify
    • Place code where it belongs

No Duplication

  • Strive to only say something once in your code
  • If multiple items use a variable, do not duplicate the variable unless it is more important to duplicate for revealing intent

Fewest Elements

  • Remove what is not being used
  • You have source control so don’t be afraid to remove things
  • Use source control