One Project, Three Ways I Changed How I Write Kotlin
summary
Built a turn‑based card game exposes three concrete lessons: a single flexible Hero class with nullable effect fields produces invalid states, replaced by a sealed hierarchy so the compiler forces exhaustiveness; adding layers of types looks neat but costs time and clarity, so each abstraction must earn its place; a single mutable GameState prevents Compose from seeing changes because the reference never changes, fixed by an immutable snapshot and strict unidirectional data flow, which required rewriting logic but simplified testing and UI updates.
AI-written summary · about
