picostitch
crafting (and) JavaScript

OO (with Message passing) - explained by Sandi Metz

I have been titled as a Sandi Metz fanboy, I am :). I use "send to" and "plays the role" since I read her book poodr.

If you are looking for actionable hints about how to do OO right, remember those four:

Isolate the thing that varies
Name the concept
Define the role
Inject the players

more info you find in her railsconf talk linked below where she talks about

Inheritance is for specialization, not for sharing code

and find here why

the IF keeps us from thinking OO

I also like to quote her on

Inheritance is a knife that turns in your hand