RailsConf 2014 - All the Little Things by Sandi Metz
ConfreaksYouTube ↗
Further reading 2
What does a module promise its callers? →Try replacing a module whose callers rely on its incidental return order. Start with what the interface says, then trace the decisions it hides and the behaviors people have learned to expect.This video helps answer · Small objects or small interfaces?Does splitting code actually split its dependencies? →Start with a rule that sends an email. Separate deciding from doing, then inspect layers, objects and abstractions: which parts must still change together when the rule changes?This video helps answer · Can small components still be tightly coupled?
Caption notes
Refactor the Gilded Rose pricing rules in small, tested steps. Metz tolerates duplication until a useful abstraction becomes visible.
Original passages · 5
It is far cheaper to keep duplication than it is to have to mess
with the wrong abstraction.I have separated
the reason I'm switching from the thing I do when I switch.Intermediate refactorings often
make code more complicated, but if you know the rules,make smaller thingsIt is far cheaper to keep duplication than it is to have to mess with the wrong abstraction.