Side-effects are not your friend
summary
Compares Haskell’s Haskell value vs variable distinction to Ruby and Scala, shows how the compiler can optimize immutable values, and demonstrates concrete refactorings: pull an impure increment_by into a pure add, compose functions, and replace loop-with-vars with map/reduce so tests no longer require instantiating a whole Calculator object. Explains ActiveRecord as ActiveRecord as convention for side effects, argues to extract pure functions and count assignments per coding session to reduce brittle coupling and costly tests.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:45Haskell
- 2:53Rename
- 4:02Value vs Variable
- 4:50Variable is immutable
- 6:21Ruby makes no distinction
- 6:39There is no variable
- 7:20Value is not variable
- 8:46No assignment
- 10:24Security
- 14:08Test
- 21:22Undo
- 21:58Multistep
- 22:51Taming sideeffects
- 24:33ActiveRecord
- 25:57Moral of my story
related talks
01h 01mLeaving side effects aside
01h 00mLogic vs. side effects: functional goodness you don't hear about
14mFundamentalist Functional Programming
33mBetter Ruby through Functional Programming
34mPrinciples of functional programming with examples in Java and Haskell
44mEffects, Algebraically yours ..
01h 04mHaskell - A Peek Inside the Ivory Tower
25mLaziness is a Virtue: Lazy, Functional, Immutable Ruby
