Type Safety and clear error objects in Kotlin
summary
Uses a concrete updateTimer(id, minutes, seconds) example to show why three Ints lose meaning and cause silent bugs; replaces minute/second Ints with a duration class and replaces raw Int IDs with a typed ID value class (or generic ID) so validity checks are unified and inlined. For return values compares nullable, Java Optional, and Either (Arrow) so errors carry reasons and enable railway-style happy/error flows across data, domain and view layers.
AI-written summary · about
chapters (8)
- 0:00Type safety in Kotlin
- 1:56Context in method params
- 6:14ID handling with types
- 8:50Performance impact of typing
- 9:13Data mapping across layers
- 12:51Errors in return types
- 15:02Arrow Either for errors
- 17:09Railway oriented programming








