Since I've been coding in Kotlin my usage of classes has highly reduced (except on Android). It's mostly some set of functions in a kt file. Is that good practice??
y
Youssef Shoaib [MOD]
10/27/2022, 9:46 AM
Depends on the complexity of your applications. Personally I found myself using a lot more `data class`es and a lot less normal classes just because data classes make sense in a lot of contexts.
✅ 1
a
ayodele
10/27/2022, 10:11 AM
Yeah, same thing here. I use data classes alot
p
Pablichjenkov
10/28/2022, 1:11 AM
I believe is a good thing. You are becoming more of a functional programmer. The philosophy behind a class was encapsulating a mutable state and provide methods/actions to mutate that state. That philosophy brings pain with it, modern practices point out that is better modeling your program as a set of functions that process/produce immutable state, less prone to errors and bugs.