Immutable Ruby
summary
Shows concrete Ruby/ Rails bugs caused by mutable state (memoized fullname, verified email changes, AR errors, hash keys breaking), then builds workable alternatives: values gem value objects for fast, DB‑free tests; ice_nine deep freeze and an immutable ActiveRecord mixin for write‑once tables; event sourcing with Postgres as the canonical event store and Neo4j replayed back into Postgres; and Hamster persistent vectors for immutable collections, with tradeoffs: more allocations and occasional performance workarounds.
AI-written summary · about
chapters (16)
- 0:00Start
- 0:05Immutable Ruby Michael Fairley @michaelfairley
- 0:17Braintree
- 1:16Mutation causes problems
- 4:28Date & Time January 8, 2011
- 5:00Text Michael "In the beginning..."
- 7:33Values helps define your boundaries
- 7:48Testing value objects is simple and fast
- 10:29Values don't need methods
- 12:41Capture all changes to application state as a sequence of events
- 13:40Events Debits and credits (12/6/2012 16:30,"35.00", 110, 7)
- 13:52Derived state Balance
- 18:55Immutability lets you break the rules
- 19:47Normalization
- 24:00Boundaries Function Core/Imperative Shell
- 26:05PDSs are (somewhat) efficient








