Kotlin Value Class: Type Safety Without Runtime Overhead | by Shbazhenov | Apr, 2025

Kotlin Value Class: Type Safety Without Runtime Overhead | by Shbazhenov | Apr, 2025

Kotlin’s value class is one of the cleanest tools for writing safe, expressive, and efficient code — and it’s shockingly underused. If you’re modeling identifiers, measurements, or business rules, and still relying on String and Int, it’s time to upgrade to value classes. Just remember: ✅ On JVM (including Android), you must annotate every value … Read more

🧵 How to Answer Like a Kotlin Coroutine Expert: Kotlin Coroutine Suspension Under the Hood | by Shbazhenov | Mar, 2025

🧵 How to Answer Like a Kotlin Coroutine Expert: Kotlin Coroutine Suspension Under the Hood | by Shbazhenov | Mar, 2025

Take this simple example: suspend fun functionA(param: Int): String {return “hello $param”} When compiled, the Kotlin compiler transforms it to something like: public static final Object functionA(int param, Continuation super String> $completion) {return “hello ” + param;} An extra parameter of type Continuation was added. The return type changed from String to Object (or Any? … Read more