Laziness is a Virtue: Lazy, Functional, Immutable Ruby
summary
Argues that computing values only when needed improves readability and changeability and shows concrete Ruby techniques: refactoring a Rails controller to defer current_account, using the memoization idiom (and its thread and nil caveats) and the memorizable/memo gems, defining immutable value objects with Ruby 3.2 data class and overrides, using ActiveRecord lazy relations and Lazy enumerators to build queries without executing them, and applying a functional-core/imperative-shell pattern to keep side effects isolated.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:05Laziness
- 3:20Memorization
- 10:31Functional Programming
- 12:04Lazy
- 15:54Better Styles
- 17:37Lazy Manifesto








