Ruby Science: Naming, Decorators, and Mixins

Joe Ferris

We pushed another update to Ruby Science today which includes five brand new chapters. Current readers can grab the update on Learn.

This week’s updates dive into three important topics. New chapters:

  • Smell: Uncommunicative Name
  • Solution: Rename Method
  • Solution: Extract Decorator
  • Smell: Mixin
  • Solution: Replace mixin with composition

The first two chapters discuss the importance of naming methods and classes. We discuss how to use class and method names to improve readability and discover classes and methods that need refactoring.

Another chapter demonstrates how to extract concerns in a repeatable, combinable way using the Decorator pattern.

The last two chapters provide tips for identifying and fixing mixin abuse.

The book is a work in progress, and currently contains around 145 pages of content. A $49 purchase gets you access to the current release of the book, all future updates, and the companion example application. In addition, purchasers can send thoughtbot their toughest Ruby, Rails, and refactoring questions.

Get your copy of Ruby Science today.