Functional Refactoring: How to Approach It
summary
Concrete Scala refactoring techniques to make code functional: replace nulls, vars and throws with Option/Either for explicit signatures and Result types for errors; convert loops into filter/map with small composable predicate functions; and confine side effects by wrapping file reads/writes in an IO/task that defers execution so parsing and tests can run without touching the filesystem. The talk shows concrete code transformations and explains that using an IO wrapper preserves previous behavior while enabling pure business-logic extraction and easier testing.
AI-written summary · about
chapters (10)
- 0:00Functional programming intro
- 8:02Pure functions and side effects
- 11:54Refactor imperative to FP
- 17:07Collections and generic functions
- 23:31Extract business predicates
- 26:41Handling unavoidable side effects
- 30:36Delaying side effects with IO
- 34:12Progressive FP adoption
- 37:41FP best practices
- 44:01Q&A
related talks
01h 00mWhat The Functional Programming
36mHow functional programming change my Java code
49mMining Functional Patterns
55mFunctional Programming Patterns with Java8
48mKotlin & Functional Programming: pick the best, skip the rest
34mHow I learned to stop worrying and love Functional Design
37mPragmatic Functional Refactoring with Java 8
02h 49mFrom Java to Scala 3, from Lambdas to Functional Programming: More Readable, More Expl...
