finnally we can know why we need those sealed interfaces , thanks
@hinocenciopaulo5 ай бұрын
Finally someone that could make me understand why we need sealed interfaces. Thank you!
@CharfaouiYounes5 ай бұрын
My pleasure man 🫡🫡
@rob924005 ай бұрын
Hello! Do you think that, in the simple casese where we don't need a complex hierarchy, sealed classes and sealed interfaces are interchageable? I'm working on a project where developers tend to migrate from sealed classes to sealed interface for the sole purpose of sparing a couple of parenthesis. In my mind, the interface approach is more appropriate when there's behaviours (rather than properties) than need to be shared, so it leads to unproductive discussions :) It seems that Kotlin basically provides 2 ways to achieve very similar results, but they both stem from different concepts at the Java level. What do you think about this?
@iyadzac5 ай бұрын
what about performance and memory? i think sealed interfaces don't need to instantiated, right?
@CharfaouiYounes5 ай бұрын
Yeah but this is too negligible, and you won't notice any difference in performance at all!