Skip to content

Instantly share code, notes, and snippets.

@anolson
Last active November 3, 2016 20:49
Show Gist options
  • Save anolson/993312cc44cb63300c70205e69febaee to your computer and use it in GitHub Desktop.
Save anolson/993312cc44cb63300c70205e69febaee to your computer and use it in GitHub Desktop.
Confident Ruby Notes

Confident Ruby Notes

Chapter 1 – Introduction

Four parts of a method

  1. Collecting input
  2. Performing work
  3. Delivering output
  4. Handling failures

Methods should group these parts together and in that particular order. When these parts of a method are mixed-up, it causes extra congnitive overload (like trying to read a choose your own adventure book from start to end).

Chapter 2 – Performing Work

  • A fundamental feature of OOP is sending messages (SM)

Basics to writing maintanable code

  1. Identify the messages to perform a task
  2. Identify the roles that receive those messages
  3. Map those roles onto existing objects.
  • Roles are duck types
  • Switch statement smell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment