Start writing Ruby (stop using classes)
summary
Argues that Ruby developers overuse classes and should reserve class for object factories only, favoring plain functions, modules, structs and hashes instead; shows that ActiveRecord subclasses inject 780 methods injected and that many service/worker/controller classes are really just single functions; recommends modules or structs instead, starting small with start with a single main.rb and refactoring into pure functions to reduce coupling, simplify tests, and eliminate invalid-after-new and data-bucket antipatterns.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:05OO not class-oriented
- 3:13Rule 1: Classes are factories
- 5:44Rule 2: Avoid pattern classes
- 7:30Abstract classes in Ruby?
- 9:18Active Record Base not a class
- 11:46Single-method classes
- 13:20Classes with state
- 14:32Invalid objects after init
- 16:01Builder pattern is a module
- 17:33Data buckets not classes
- 19:26Structs for data buckets
- 21:34Classes without instances
- 21:57Action Controller not a class
- 23:25Why stop using classes
- 25:11Benefits of class-free code
- 28:26Stop writing classes
- 29:30Simplify directory structure
- 30:36Avoid deep nesting
- 30:57Start with hashes
- 31:39Have fun coding








