~/talk

Start writing Ruby (stop using classes)

Talkat San Francisco Ruby Conference 2025 · 2025-11-19..11-21· [ruby]
slides:none on file

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

  1. 0:00Introduction
  2. 1:05OO not class-oriented
  3. 3:13Rule 1: Classes are factories
  4. 5:44Rule 2: Avoid pattern classes
  5. 7:30Abstract classes in Ruby?
  6. 9:18Active Record Base not a class
  7. 11:46Single-method classes
  8. 13:20Classes with state
  9. 14:32Invalid objects after init
  10. 16:01Builder pattern is a module
  11. 17:33Data buckets not classes
  12. 19:26Structs for data buckets
  13. 21:34Classes without instances
  14. 21:57Action Controller not a class
  15. 23:25Why stop using classes
  16. 25:11Benefits of class-free code
  17. 28:26Stop writing classes
  18. 29:30Simplify directory structure
  19. 30:36Avoid deep nesting
  20. 30:57Start with hashes
  21. 31:39Have fun coding
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.