Representing State: the Kotlin Edition
summary
Concrete takeaways for Kotlin: avoid bare booleans by encoding intent (the talk coins boolean blindness), replace ad hoc flags with sealed classes and data classes so states are bounded and testable, and lift freeform values like Strings or Ints into enums/value classes to lift unbounded types into bounded types. Use interfaces or explicit state types to capture computed facts (memoize work like “autoplay eligible”), model loaded/not-loaded with exclusive access to data, and prefer compile-time constraints over mutable, nullable, lateinit assumptions.
AI-written summary · about
chapters (12)
- 0:00Start
- 7:33Boolean Blindness
- 14:41Expressive types have other advantages!
- 18:00When you break data up use expressive types to capture that break in a place that can be used again.
- 20:12Strings are danger.
- 27:13What does this look like?
- 34:11Why do we care?
- 34:42You cannot make assumptions about how they will use your code.
- 39:53Sealed Classes Everywhere!
- 41:27Strings shouldn't be used.
- 41:52Have an impervious review system?
- 42:16Writing code where mistakes are catastrophic?








